Your question makes no sense. There is no fixed number of years in Canada required for getting permanent residency, and there is no fixed number of years in Canada which guarantees permanent residency. It is sometimes possible to get permanent residency before ever entering Canada, for example by family sponsorship, or the federal skilled worker class. It is also possible to spend many years in Canada without ever qualifying for permanent residency, for example on a student visa.
You may be thinking of Canadian citizenship. You need to spend three years in Canada as a permanent resident to qualify for Canadian citizenship (this will soon change to four years). Only years spent in Canada after you get PR count for citizenship.