I am thinking about moving to Spain and buying a property there to become resident in Andalusia. The thing is I also own a few small properties outside the EU that I would like to sell. If I move to Spain say for a couple of years, take up residency and then decide to sell my international property could I move to a tax free area, leave spanish tax residency for a year and sell the property without any tax liability in Spain? Would there be any taxes to pay if I then returned to Spain the following year and continued with tax residency there?

Thanks