To keep your permanent resident status, you must have been in Canada for at least 730 days during the last five years. These 730 days don’t need to be continuous. Some of your time abroad may count towards the 730 days. See can my time abroad count towards my permanent resident status?
To help you track your time in Canada, use a travel journal.