Comes from: Costs of being a houseowner in Spain | part 2: “taxes”
Sometimes things just don’t work out the way you thought they would and for whatever reason you decide to sell. This may take sometime but at some point you will find a buyer. At that moment you must be aware that once you sell you have to pay tax on this sale. Also in case of sale you have to distinguish between the resident seller, and the non-resident seller.
For non-resident seller the buyer is obliged to retain 3% of the sales/purchase price, this retention has to be paid to the tax office on account of the benefit tax of the seller. The seller after that has to present a tax return declaring the real benefit. This real benefit will be calculated deducting from the sales price, in the first place the original purchase price, and after that deducting any costs made for example renewing the property, transfer tax paid at the moment of purchase, etc. The non-resident seller will have to pay after that 19% (at least at this moment, may 2021, the government can change the percentage in the future), on this benefit, the 3% retained previously by the buyer will be deducted from this amount. In case the seller has had no benefit or the 3% retained is too much, the seller can apply for the money to be returned.
In case you have renewed the property but you have not included this renewal in the property register (by the “ampliación de escritura de obra nueva”), you should do this before signing any sales deed. This can be used to update the value of the property, and so pay less benefit tax afterwards.
As a resident if you sell your property, if you are over 65 years old and you have lived there for more than 3 years, no benefit tax is due. If not, the sale has to be declared in your normal income tax form, and the benefit will be taxed accordingly. But as a resident in case you reinvest the money within two years after the sale in another property, the reinvested amount will not be taxed.
Apart from this “benefit tax” in most cases you also have to pay a municipal “plusvalia” tax. This is paid on the difference of Kadastervalue of the plot at the moment of purchase and the kadastervalue of the plot at the moment of sale. Every town established it’s own rate so for me here it is impossible to give you a clear figure.