Taxes and costs · January 2023
Taxes when selling a home in Spain (part II): when the gain is exempt
In the first part I explained the two main taxes when selling a home. In this second part I go through the cases in which the gain is exempt from Spanish income tax.
SHORT ANSWER
The gain on selling a home is exempt from Spanish income tax (IRPF) in several cases, including when someone over 65 sells their main home, when the main home is handed to the bank to cancel the mortgage, or when it is donated to a non-profit.
IN THIS ARTICLE
In the first part we explained that there are two main taxes when selling a home: income tax (IRPF) on the capital gain and the municipal capital gains tax (plusvalía). We focused on the first, how it is calculated and which rates apply, without leaving the general rule. This second article, published in the January 2023 Newsletter, focuses on the exceptions.
These exemptions belong to IRPF, the tax paid by Spanish tax residents; non-residents are taxed under their own rules. And the rules change: for current figures, see Taxes When Selling a Home in Marbella (2026).
The five cases in which the gain is exempt
As a general rule, the gain on selling a home is taxed under IRPF. These cases are exempt:
Over 65 or dependent
The sale of the main home by people over 65 or by people with severe or high dependency.
Historical Heritage
Handing over assets of the Spanish Historical Heritage to pay an income tax debt.
Donations
Donating a property in a way that gives a tax deduction: to non-profits, foundations or associations of public utility.
Dación en pago
Handing over the main home to cancel a mortgage debt, also if foreclosure has already happened.
2012 purchases
50% of the gain on properties bought between 12 May and 31 December 2012.
1. Over-65s: what counts as the main home
As a general rule, the main home is the one you have lived in for at least three years. It also includes a new home you have lived in since it was completed or bought, or one you had to move to for a justified reason, such as marriage, divorce or work.
2. Handing the main home to the bank (dación en pago)
Both the debtor and their guarantor qualify, provided the home is handed to banks, credit institutions or other entities that grant loans or mortgages professionally. The same exemption applies if foreclosure has already taken place. To use it, the owner or their guarantor must not have other assets with which to pay the whole debt and avoid foreclosure.
Every case is different: before selling, review your details with your lawyer or trusted tax adviser.
Alfonso Lacruz
3. The other three cases
The remaining cases are more specific: handing over assets of the Spanish Historical Heritage to pay an income tax debt, donations to non-profits, foundations or associations of public utility that give a tax deduction, and a 50% exemption on the gain for anyone who bought between 12 May and 31 December 2012, under Royal Decree-law 18/2012, which aimed to revive property sales.
In summary
The general rule is to pay tax on the gain, but there are five exceptions worth knowing before you sell. As every case is different and these articles cannot cover every detail, I recommend reviewing your situation with your lawyer or trusted tax adviser. If you do not live in Spain, read Resident or Non-Resident: Taxes When Selling.
Frequently asked questions
Do over-65s pay income tax when selling their home in Spain?
Not on the gain, if they sell their main home. As a general rule, the main home is the one lived in for at least three years. The exemption belongs to IRPF, for Spanish tax residents.
Is handing the home to the bank exempt?
Yes, the gain from handing over the main home to cancel the mortgage is exempt, provided the owner or their guarantor has no other assets to pay the whole debt.
Do these exemptions apply to non-residents?
These exemptions belong to IRPF, the tax paid by Spanish tax residents. Non-residents pay Non-Resident Income Tax under its own rules, so check your case with a tax adviser.
The figures are indicative and every property is different: for a specific number, ask for a valuation of your home.
Sources: Spanish Income Tax Law 35/2006 (article 33.4 and additional provision 37); Royal Decree-law 18/2012; own analysis. Published in the January 2023 Newsletter. For information only: it does not replace tax advice.
Thinking of selling your home on the Costa del Sol?
Start by knowing where your home stands in today’s market.





