Monaco, Cyprus, Malta, Gibraltar, Isle of Man, Guernsey, UK non-dom, and the list goes on.
There is an easy solution: don't buy real estate in
Spain.
There are many countries that ACTIVELY discourage you from
buying real estate. Switzerland for example will ask you to pay TAX for POTENTIAL RENTAL INCOME that you did NOT receive, if your apartment is empty and you do not live in it. What's the solution? DON'T BUY REAL ESTATE IN SWITZERLAND.
This obsession with buying real estate is very middle-class. When you calculate all your costs, potential legal problems, regulatory problems, you will see that you underperform a simple ETF with 10 times the headache. This is also for 'good' jurisdictions - just a reminder that if you bought real estate in Dubai in 2009 you're still underwater on your
investment.