How is tax residency decided?
Most countries use tests such as days spent in the country (often 183), a permanent home, your centre of vital interests and where your family lives. Meeting the test in one country does not automatically end residency in another, so leaving needs to be planned.
Read the full guide