Only time on permanent residence, or another status that is not temporary, counts. Years on a work or study permit before that do not.