What is Tax Residence?

Legal Definition
The criteria for residence for tax purposes vary considerably from jurisdiction to jurisdiction, and "residence" can be different for other, non-tax purposes. For individuals, physical presence in a jurisdiction is the main test. Some jurisdictions also determine residency of an individual by reference to a variety of other factors, such as the ownership of a home or availability of accommodation, family, and financial interests. For companies, some jurisdictions determine the residence of a corporation based on its place of incorporation. Other jurisdictions determine the residence of a corporation by reference to its place of management. Some jurisdictions use both a place-of-incorporation test and a place-of-management test.

Domicile is, in common law jurisdictions, a different legal concept to residence, though the two may lead to the same result.

The criteria for residence in double taxation treaties may be different from those of domestic law. Residency in domestic law allows a country to create a tax claim based on the residence over a person, whereas in a double taxation treaty it has the effect of restricting such tax claim in order to avoid double taxation. Residency or citizenship taxation systems are typically linked with worldwide taxation, as opposed to territorial taxation. Therefore, it is particularly relevant when two countries simultaneously claim a person to be resident within their jurisdiction.
-- Wikipedia