Dear Mr. X,
The Capital Gains Tax in Spain, for non residents, is 35% on the gain, to explain what is exactly the net gain in this forum would be rather long.
The 5% retention on the price, applied when you sell before the notary, is just a guarantee for the Spanish Government that the non resident is going to pay the Capital Gains Tax. This rule had to be implemented few years ago due to the fact that many british (and other europeans) people went away without paying their taxes to the Spanish Tax office after selling their property.
If the 35% tax is higher than the retention then you are obligued to pay the extra on top, now the tax offices in the European Union are more linked and in more cooperation. If you think that you can get away without paying the taxes in Spain you risk a nusty surprise back home….
Finally let me tell you: you can not pretend to come to Spain to live, even part of the year and not contribute for the maintenance of our roads, hospitals, airports, etc, etc.
Jose Maria Sánchez Alfonso
Abogado / Lawyer
Málaga / Costa del Sol