Yeah the basic rules are:
- tell your country you have expatried in the correct way
- no wife or kids in the country
- not more than 183 days in the country
Som UE countries, including Spain, if you move to Dubai basically requires you to demonstrate you have moved, so having a permanent residence in the UAE, and being out of the country for more than 183 days.
What I have never been able to clear is what happens if you do not trigger
tax residency anywhere, I thought for a while you had to pay taxes in the country of
citizenship, but not 100% sure about this, people on the forums said no.
In any case there are two important moments usually, when you leave ( especially if you were a high taxpayer, maybe around 150/200k in inconme ) and when you re enter the country, especially if you bring in money. And in general your country of birth is the place where you risk more.