Figuring out your residency status can be tricky, especially since it depends on so many factors that vary from person to person. Thankfully, the CRA has provided some guidelines to help you Determining your residency status.
If you'd like the CRA’s opinion (it won't be legally binding) on your residency status, you can fill out one of the following forms (whichever is applicable) and mail it to your tax centre. For a more accurate result, include as much as information as possible.
Related information:
What is the difference between factual and deemed residency?
My residency status changed. Where in TurboTax do I put the date I became/ceased to be a Canadian resident?