An individual can only be resident for tax purposes in one country, which will be where they will be taxed on their income earned held anywhere in the world. However, the tax authorities in two countries may consider that the individual is resident in both, which would result in double taxation prohibited under international tax law and internal Spanish law. In this case, the tie-breaker rules included in the double tax treaty signed by both countries must be applied.
The most common tie-breaker rules are the following and must be applied successively:
1. Individuals are considered residents in the country in which they have a permanent home.
2. If they have a permanent home in both countries, the centre of vital interests is considered.
3. When the centre of vital interests cannot be determined, the taxpayer is resident in the country where they habitually live.
4. If they do not habitually live in either country, or they habitually live in both countries, the taxpayer is resident in the country of which they are a national.
5. If they are a national of both countries, the competent authorities must solve the dispute by mutual agreement, according to the amicable procedure included in article 25 of the OECD Model Tax Convention.
Each of these rules is described in more detail below:

1. Permanent home.
Residence will be in the country where the individual owns or uses a home that is furnished and reserved for permanent use, as opposed to a short-term stay. The accommodation must be available at any time, all year round (this can be proven from electricity consumption). The definition of home is in any of its forms (house or apartment, owned or leased, rented furnished room), as long as it is permanent.

2. Centre of vital interests
If the individual has a home in both countries, residence will be in the country where their personal/economic ties are closer, where they have family links, political/cultural relations, professional work, businesses or where their assets are manage. All of these must be considered as a whole.
If an individual buys a home in a country but keeps their previous one, the fact that they have kept the first one in a place where they have always lived, where they have worked and where their family and assets are located can, together with the above criteria, help to prove that the centre of their vital interests is in the first country.

3. Habitual abode

If it is not possible to determine where the centre of vital interests lies, residence will be in the country where the individual spends a long enough time to determine that their abode is habitual, as well as the frequency of their stays.
This could be less than a calendar year. It might be that an individual has lived in both countries in the same year. In the case of Spain, the tax year runs from 1 January to 31 December and there is no split-year treatment due to change of residence.

Where the habitual abode test is not decisive, residence will be in the country where the individual is a national. If the individual is a national of both countries (or of neither), then the countries must settle the matter by mutual agreement.

It should be noted that the above tie-breaker rules are the most common ones. However, each specific agreement must be checked for specific requirements or to find out whether either country has objected to how the tie-breaker rules are interpreted.