You need to meet/be in compliance with the residency obligation. That is NOT correctly stated as having lived in Canada 730 days (although often put that way, it's not exact).
My preferred simplified way to state this: you are in compliance if your total number of days OUTSIDE of Canada is LESS than 1095 days in the last five years or since date of becoming a PR (if you became a PR more recently than five years).
[1095 days is simply an arithmetic restatement of five years * 365 days minus 730 days. It provides for fact that IRCC gives 'credit' for days remaining in your first five years, basically.]
Even more simply: if you became a PR less than three years ago (as of the date you apply to sponsor spouse), you are in compliance (because three years * 365 is 1095, if less than three years have passed, you cannot have been outside more than 1095 days).