Basically you need to spend 730 days in Canada in any 5 year period but there are exceptions as seen at
http://www.cic.gc.ca/english/resources/manuals/op/op10-eng.pdf on page 7:
Pursuant to A28(2), a permanent resident complies with the residency obligation provisions with
respect to a five-year period if, for at least 730 days in that five-year period, the permanent
resident is physically present in Canada, or:
• is outside Canada accompanying a Canadian citizen who is their spouse or common-law
partner or is a child accompanying a parent;
• is outside Canada employed on a full-time basis by a Canadian business or in the public
service of Canada or of a province;
• is an accompanying spouse, common-law partner or child of a permanent resident who is
outside Canada and is employed on a full-time basis by a Canadian business or in the public
service of Canada or of a province.