When you are a permanent resident, you can live outside of Canada, but must live in Canada for at least two years (cumulatively) in a five-year period. If you live outside of Canada for longer, you may lose your permanent resident status.
To be eligible for Canadian citizenship, you must have lived in Canada for at least three years (1,095 days) out of the four years (1,460 days) preceding your application. Please note that you cannot meet the residence requirements for citizenship without a minimum of two (2) years as a permanent resident.
When calculating your time in Canada:
only the four (4) years preceding the date of your application are taken into account;
each day you lived in Canada before you became a permanent resident counts as half a day;
each day you lived in Canada after you became a permanent resident counts as one day;
time spent serving a sentence for an offence in Canada (e.g. prison, penitentiary, jail, reformatory, conditional sentence, probation and/or parole) cannot be counted toward residence - there are some exceptions to this rule;
absences from Canada may have an impact on your residence. Only a citizenship judge can determine if you meet the residence requirements with fewer than 1,095 days of physical presence.