It’s not just the 183 days
Under Spanish law you are tax resident if you spend more than 183 days in Spain in a calendar year, or if Spain is the main centre of your business or economic interests. Spain also presumes you are resident if your spouse and dependent minor children habitually live in Spain.
Meeting a single criterion can be enough, so reducing the days you spend in Spain is not always sufficient.
If there is a conflict, the tax treaty decides
If Spain and another country could both consider you resident, the double taxation treaty between them — where one exists, as with the UAE — sets tie-breaker rules: permanent home, centre of vital interests, habitual abode and nationality.
To rely on them you need to prove your residency in the other country, usually with a tax residency certificate issued by its tax authority, among other evidence.
Leaving has a cost, and arriving has options
If you hold significant shareholdings, the Spanish exit tax may apply when you leave: it can tax unrealised gains if you have been resident for at least 10 of the last 15 years and certain value thresholds are exceeded.
If you are moving to Spain instead, from the moment you become resident you are taxed on your worldwide income — unless you qualify for the Beckham Law, which is worth analysing before you arrive.
