Buying & selling · · 22 min read
Selling your home without paying income tax (IRPF) in Spain in 2026: reinvesting in a new main residence, the over-65 exemption and other exemptions
The gain on selling your main residence pays no Spanish income tax (IRPF) if you reinvest the proceeds in another main residence within two years, or if you are over 65 or have severe or major dependency. We explain each exemption under the current law, what changed on 8 October 2026, how a partial reinvestment is calculated and what you still have to pay.

When you sell a home for more than it cost you, the difference is a capital gain that, in principle, is taxed under IRPF (Spanish personal income tax). But the law sets out cases where it pays nothing, or only part: if you buy another main residence with the money, if you are over 65 or have severe or major dependency, if you hand the home to the bank to cancel the mortgage, or if you put the money into a life annuity. Since 8 October 2026 there is also a change for people who move into a care home and a new exemption for anyone who sells an empty home to a public body.
Here we focus only on those exemptions: requirements, time limits, calculation and how to declare them. How the gain and the plusvalía municipal (municipal tax on the increase in land value) are calculated in Madrid is covered in “Taxes when selling a flat in 2026: plusvalía municipal in Madrid, income tax and exemptions”, and a full example of every cost of a sale in “How much it costs to sell a flat in Alcorcón in 2026”.
The essentials in one minute
- Reinvestment: if you sell your main residence and put the total amount obtained into another main residence within the two years before or after the sale, the gain is exempt. If you reinvest part, the proportional part is exempt.
- Over-65s and people with severe or major dependency: the gain on selling the main residence is exempt even if you do not reinvest.
- New from 8 October 2026: if you moved to a care home or to a relative’s home because of your age or dependency, the home counts as your main residence until the move.
- Dación en pago (handing the home to the lender in payment): giving your main residence to the bank to cancel the mortgage is not taxed if you have no other assets to pay the debt.
- Over-65s selling any asset: if within six months they put the money into an insured life annuity, the gain is exempt, up to €240,000 per person.
- None of these IRPF exemptions removes the plusvalía municipal. Only the dación en pago of the main residence is also exempt from the plusvalía.
What is taxed under IRPF when you sell, in two lines
IRPF does not tax the price but the gain: the transfer value (what you receive minus the costs and taxes of the sale, such as the plusvalía) minus the acquisition value (what you paid plus the purchase costs and improvements). It goes into the savings tax base and is taxed by bands:
| Gain (savings tax base) | Total rate | State + regional share |
|---|---|---|
| Up to €6,000 | 19% | 9.5% + 9.5% |
| €6,000 to €50,000 | 21% | 10.5% + 10.5% |
| €50,000 to €200,000 | 23% | 11.5% + 11.5% |
| €200,000 to €300,000 | 27% | 13.5% + 13.5% |
| Over €300,000 | 30% | 15% + 15% |
Source: articles 66.1 and 76 of Act 35/2006 on IRPF, in the 2025 tax return rules published by the Spanish Tax Agency. Each band applies only to the part of the gain that falls within it.
The exemptions at a glance
| Exemption | Requirements | Time limit | Legal basis |
|---|---|---|---|
| Reinvestment in a main residence | You sell your main residence and put the total amount obtained into another main residence; if you reinvest less, the exemption is proportional | Two years before or two years after the sale, in one go or in several | Art. 38.1 of the IRPF Act; arts. 41 and 41 bis of the Regulation |
| Over 65 | You are over 65 and sell your main residence, or its bare ownership while keeping a lifetime usufruct. No need to reinvest | Main residence at the sale or in the two previous years; if you moved to a care home or a relative’s home, until the move | Art. 33.4.b of the Act; art. 41 bis.3 of the Regulation |
| Severe or major dependency | You are in that situation under the Dependency Act and sell your main residence, at any age | The same as in the row above | Art. 33.4.b of the Act; art. 41 bis.3 of the Regulation |
| Dación en pago or mortgage enforcement | You hand over your main residence, as debtor or guarantor, to cancel a mortgage with a bank or another professional lender, without enough other assets to pay the debt | The handover itself or the court or notarial enforcement | Art. 33.4.d of the Act |
| Life annuity for over-65s | You sell any asset and put the amount into an insured life annuity in your favour. Maximum €240,000 per taxpayer | Six months from the sale | Art. 38.3 of the Act; art. 42 of the Regulation |
| Selling an empty home to a public body | You sell to a public authority or public company for social housing a home left empty without justified cause for the previous two years, for less than €800,000 | Sales from 8 October 2026 to 31 December 2027 | Additional provision 65 of the Act (Royal Decree-Law 29/2026) |
| Residents of another EU or EEA country | You sell what was your main residence in Spain and reinvest the amount in a new main residence | Declared on form 210 with code 33 (reinvestment before the sale) or 34 (after) | Additional provision 7 of the Non-Resident Income Tax Act |
Llavely summary as of 20 November 2026 based on Act 35/2006 and Royal Decree 439/2007 as published by the Spanish Tax Agency, Royal Decree-Law 29/2026 (BOE) and the Tax Agency’s manual for non-residents.
Reinvestment in a main residence, step by step
This is the exemption for people who sell in order to buy another home. The Act refers to the Regulation, which sets out four points:
- What must be reinvested: the total amount obtained from the sale, not just the gain. If you reinvest less, only the part of the gain that corresponds to what you reinvest is exempt.
- Within what time: within the two years after the sale, in one go or in several. Money put into a new main residence bought in the two years before the sale also counts.
- If you are paid in instalments: if you sell with deferred payment, you are treated as reinvesting in time if you put each instalment into the new home in the period in which you receive it.
- What counts as buying: as well as a purchase, renovation of the home on the terms of the Regulation (for example, reconstruction costing more than 25% of the purchase price or market value, excluding the land).
The new home has to become your main residence: you must actually and permanently live in it within twelve months of buying it or of the works being finished. If you buy it to let or as a second home, it does not count. If you are going to sell and buy at the same time, we explain how to fit the dates together in “Selling your home and buying another at the same time in Madrid (2026)”.
If the home you are selling has a mortgage
This is one of the most common questions. The IRPF Regulation answers it expressly: if you bought the home you are selling with a loan, the total amount obtained is the transfer value minus the principal of the loan still outstanding at the time of the sale. In other words, the money that goes to cancel the mortgage at the notary does not count as an amount you have to reinvest. What you need to put into the new home to be fully exempt is what is left once that outstanding principal is deducted.
To know that figure, ask your bank for a certificate of the outstanding debt. How the mortgage is cancelled on the day of signing is explained in “Selling a flat with a mortgage in 2026”.
Example for guidance: selling for €320,000 and reinvesting €200,000
Suppose you sell your main residence with a transfer value of €320,000 (after the costs of the sale) and a gain of €150,000, and you buy another main residence for €200,000 within the time limit, with no other savings income that year. We look at it with no outstanding mortgage and with €70,000 outstanding at the sale.
| Item | No outstanding mortgage | With €70,000 outstanding |
|---|---|---|
| Transfer value | €320,000 | €320,000 |
| Loan principal outstanding at the sale | €0 | €70,000 |
| Total amount obtained (what you would need to reinvest to be fully exempt) | €320,000 | €250,000 |
| Reinvested in the new main residence | €200,000 | €200,000 |
| Exempt share (reinvested ÷ total amount obtained) | 62.5% | 80% |
| Gain on the sale | €150,000 | €150,000 |
| Exempt gain | €93,750 | €120,000 |
| Taxable gain | €56,250 | €30,000 |
| IRPF on the taxable gain | €11,817.50 | €6,180 |
| IRPF if you reinvested nothing | €33,380 | €33,380 |
Llavely calculation for guidance (20 November 2026) using article 41 of the IRPF Regulation and the savings scale in articles 66 and 76 of the Act (19% up to €6,000, 21% up to €50,000 and 23% up to €200,000). Assumes no other savings income in the year. This is not tax advice: your case may differ.
With no mortgage, the €200,000 reinvested is 62.5% of the €320,000 obtained, so 62.5% of the gain is exempt: €93,750. On the other €56,250 you pay €11,817.50 (19% on the first €6,000, 21% on the next €44,000 and 23% on the rest), compared with €33,380 without reinvesting.
With €70,000 of mortgage outstanding, the amount that counts is €250,000, and the same €200,000 reinvested is now 80%. €120,000 is exempt and €30,000 is taxed: €6,180 of IRPF. If you reinvested €250,000, the gain would be fully exempt.
What counts as a main residence: the three years and the exceptions
The two main exemptions, reinvestment and the over-65 exemption, require you to sell your main residence. Article 41 bis of the Regulation defines it as follows:
- You must have lived in it continuously for at least three years.
- Even if you have not reached three years, it counts as your main residence if you have to move because of death or other circumstances that necessarily require it: marriage, separation, a job transfer, getting a first job or a better one, or other similar circumstances you can justify.
- You must have moved in within twelve months of buying it or of the works being finished, with some exceptions.
- When you sell, it is enough for it to be your main residence on that day or to have been so on any day in the previous two years. If you moved to the new home before selling the old one, you have two years to sell it.
- Since 8 October 2026, if you are over 65 or have severe or major dependency and moved to a care home or to a relative’s home, it counts until the day of the move (see below).
- In the case of separation, divorce or annulment, the requirement is treated as met when it applies to the spouse who stayed in the home.
What counts is where you really live: it is worth being able to prove it with the padrón (municipal register of residents) and bills in your name.
How to state your intention to reinvest and what happens if you end up not reinvesting
The sale is declared in the tax return for the year in which you sign. If you sell in 2026, that is the 2026 return, filed in 2027. In the return, property sales go in section F2 (capital gains and losses from the transfer of real estate), which has its own sub-section for the reinvestment exemption. If you do not buy the new home in the same year, the Regulation requires you to state in that return your intention to reinvest under the conditions and time limits set by law.
For each property sold, the Spanish Tax Agency asks for the cadastral reference, the dates and amounts of the purchase and the sale with their costs, whether it was your main residence and the outstanding mortgage principal. If the home has several owners, each one states only their share.
If you end up not reinvesting, or you fail to meet a requirement (for example, you never move into the new home), the part of the gain that is not exempt is allocated to the year of the sale through a supplementary self-assessment, with late-payment interest. It is filed between the date of the breach and the end of the filing period for that year.
Over 65: exempt without reinvesting
If you are over 65 and sell your main residence, the gain is exempt even if you do not buy another home with the money. There is no cap on the amount for this exemption. The Spanish Tax Agency lists it in its IRPF manual for over-65s among the “income not declared”.
- The home must be your main residence on the day of the sale or have been so on any day in the previous two years, under the three-year rules we have just seen.
- If you sell the bare ownership and keep a lifetime usufruct, it also applies. We explain this in detail in “Selling the bare ownership of your home and still living in it in 2026”.
- If the property was already split between a bare owner and a usufructuary and they sell together, the Tax Agency makes clear that it applies to neither of them.
- The exemption is from IRPF. The plusvalía municipal is still payable (see the end).
If you live in a care home or with a relative: what changed on 8 October 2026
Until October 2026, anyone who moved into a care home had, in practice, two years to sell with the exemption. Royal Decree-Law 29/2026 (BOE of 7 October) changed article 41 bis.3 of the IRPF Regulation with effect from 8 October.
Now, for the over-65 exemption and the reinvestment exemption, if you are over 65 or have severe or major dependency and moved your residence to a specialised centre or to the home of a relative up to the third degree because of your age or dependency, the home counts as your main residence until the time of the move. For this case the text does not set the two-year limit of the general rule. This includes, for example, children, grandchildren, siblings, nephews and nieces or uncles and aunts, also those of your spouse.
The decree-law was validated on 12 November 2026, so the change remains in force. Keep the documents that prove the date and the reason for the move (care home contract, padrón, dependency decision) and review your case with an adviser.
Severe or major dependency
The same exemption as for over-65s applies to anyone in a situation of severe or major dependency under the Act on the promotion of personal autonomy and care for people in a situation of dependency, whatever their age. The requirements are the same, including the rule on moving. Keep to hand the decision recognising the degree.
Dación en pago and mortgage enforcement
If you hand your main residence to the bank to cancel the mortgage, any gain that arises is exempt. The law requires you to be the debtor or the debtor’s guarantor, the debt to be with a credit institution or another entity that grants mortgage loans professionally, and you not to have enough other assets or rights to pay the whole debt. The exemption also covers losing the home through a court or notarial mortgage enforcement with the same requirements.
It is the only one that also exists for the plusvalía municipal, if you were registered on the padrón at the home for the previous two years (or since the purchase, if less).
Over-65s who reinvest in a life annuity
This one does not require the home to be your main residence: the law speaks of “assets”, so it also works, for example, for a let flat or a second home. If you are over 65 and within six months you put the proceeds into an insured life annuity in your favour, the gain is exempt under these conditions:
- Maximum €240,000. The Spanish Tax Agency makes clear that the limit is per taxpayer, not per transaction: if you already used part of it on another sale, only the difference is left.
- If you put in less than you obtained, the proportional part of the gain is exempt.
- The annuity is paid annually or more often, starts being paid within one year and its annual amount cannot fall by more than 5% from the previous year.
- You must tell the insurer that the annuity is the reinvestment of the sale proceeds.
- If you take the annuity rights early, in whole or in part, the gain becomes taxable, with a supplementary self-assessment and late-payment interest.
If the annuity is not set up in the same year as the sale, you also have to state your intention to reinvest in that year’s return.
Selling an empty home to a public body, until 31 December 2027
Royal Decree-Law 29/2026 created an exemption for sales, from 8 October 2026 to 31 December 2027, to public authorities, bodies and companies dedicated to social and affordable housing. The home must have been continuously unoccupied without justified cause for the previous two years, and the transfer value must be below €800,000. Up to €200,000, the exemption is 100%. Between €200,000 and €800,000, the percentage is the result of dividing 800,000 minus the transfer value by 600,000. If the home has several owners, the percentage applies to each one’s gain.
The rest of the gain can become exempt if you reinvest the money within six months in a Financia Europa Reinvestment Savings and Investment Account (maximum €800,000). According to the Spanish Tax Agency, that account depends on a ministerial order; if it is not yet in force when you sell, the six months run from when it is.
If the home belongs to both of you: community property and co-ownership
Under IRPF, gains belong to whoever owns the asset. If the home is community property (gananciales), the gain is split half and half between the spouses, unless another share is proven. If it has several co-owners, each declares their share. And each applies the exemption that fits their situation: age, dependency or the home being their main residence are personal requirements. If one of you is over 65 and the other is not, review with an adviser which part is exempt.
If the sale comes about through a separation or divorce, remember the rule about the spouse who stayed in the home. Everything else that changes in that case is covered in “What to do with the home in a divorce or separation in Madrid in 2026”.
If you live outside Spain
If you are no longer resident in Spain but live in another country of the European Union or the European Economic Area with exchange of tax information (Iceland, Norway and, since 11 July 2021, Liechtenstein), you can apply the reinvestment exemption when you sell what was your main residence in Spain, if you reinvest the amount in a new main residence. This is governed by additional provision 7 of the Non-Resident Income Tax Act.
The buyer still has to withhold 3% of the price (form 211), and you file form 210 with code 33 if you reinvest before selling or 34 if you reinvest afterwards. If you reinvest after the filing deadline, you can claim a refund (Order HAP/2474/2015).
What these exemptions do not remove: the plusvalía municipal
The plusvalía municipal is a separate tax, charged by the town council, with its own rules: being exempt from IRPF does not free you from it. Under the Local Finances Act:
- The dación en pago of the main residence, and losing the home through mortgage enforcement, are exempt, with requirements similar to those in IRPF and that of having been registered on the padrón at the home for two years.
- There is no exemption or relief based on age. The relief each council may approve, of up to 95%, is for inheritances in favour of children, spouses and parents, and for activities of special municipal interest.
- It is not payable if there is no increase in the value of the land, but you must declare the sale and provide the purchase and sale deeds to prove it.
What does happen is the reverse: the plusvalía you pay is a cost of the sale and is deducted when calculating the IRPF gain. How much is paid in Madrid and how it is calculated is in “Taxes when selling a flat in 2026: plusvalía municipal in Madrid, income tax and exemptions”.
How we do it at Llavely
At Llavely we sell homes throughout the Community of Madrid and we take care of everything: you contact us and we handle the sale from start to finish. We have more than 35 years in the property sector and specialist lawyers. We review every home in less than 24 hours. The valuation, photos, video, floor plan and virtual tour are included. Before showing your home we talk to each buyer to find out what they are looking for and how they would pay for it. We do the viewings and you follow everything from your private seller portal.
Our specialist lawyers check the nota simple (the Land Registry summary) and any charges, request the mortgage debt certificate with you, carry out the calculation of the corresponding taxes, draft the arras (deposit contract), review the deed and go with you to the notary. If you are going to reinvest or are over 65, we help you gather the documents your tax adviser will ask for. You pay 2.5% + VAT of the price, in total, only if you sell and on the day of the notary appointment. For buyers, buying with Llavely is free. If you want to know what your home is worth, ask for your free valuation: we give you a range straight away, then we call you, see the home and fine-tune the price.
Frequently asked questions
How can I sell my home in Spain without paying income tax?
By reinvesting the proceeds in another main residence within the two years before or after the sale, by being over 65 or having severe or major dependency when you sell your main residence, or, if you are over 65, by putting the money into a life annuity within six months, up to €240,000. Review your case with an adviser.
Do I have to reinvest all the money from the sale or only the gain?
The total amount obtained, not just the gain. If you reinvest part, the proportional part of the gain is exempt. If the home had a mortgage, the total amount obtained is the transfer value minus the loan principal outstanding on the day of the sale.
If I am over 65, do I pay IRPF when I sell my home?
Not on the gain, if it is your main residence when you sell or was in the two previous years, without reinvesting and with no cap on the amount. The plusvalía municipal is still payable.
What happens if I live in a care home and sell my flat?
Since 8 October 2026, if you are over 65 or have severe or major dependency and moved to a centre or to the home of a relative up to the third degree for that reason, the flat counts as your main residence until the move (Royal Decree-Law 29/2026). Check your case with an adviser.
Where does the reinvestment go in the tax return?
In section F2 of the return, covering gains and losses on the sale of real estate, which has a sub-section for the reinvestment exemption. If you do not buy the new home in the same year as the sale, you must state your intention to reinvest in that return.
What happens if I say I will reinvest and then do not?
The non-exempt part is allocated to the year of the sale through a supplementary self-assessment with late-payment interest.
Do the IRPF exemptions free me from the plusvalía municipal?
No. Only the dación en pago of the main residence and mortgage enforcement are exempt from the plusvalía, with requirements. The law provides no exemption based on age.
Sources
- Royal Decree-Law 29/2026 of 6 October adopting urgent measures to protect the social function of housing and expand the supply of affordable housing: final provision 3, amending article 41 bis.3 of the IRPF Regulation (BOE no. 249, 7 October 2026)
- Resolution of 12 November 2026 of the Congress of Deputies ordering publication of the agreement validating Royal Decree-Law 29/2026 (BOE no. 283, 13 November 2026)
- Royal Legislative Decree 2/2004, consolidated text of the Local Finances Act: articles 104, 105 and 108 on the plusvalía municipal (BOE)
- Act 35/2006 on Personal Income Tax: articles 11, 33.4, 38, 66 and 76, in the 2025 tax return rules (Spanish Tax Agency)
- Royal Decree 439/2007, Personal Income Tax Regulation: articles 41, 41 bis and 42, in the 2025 tax return rules (Spanish Tax Agency)
- 2026 regulatory changes to IRPF: Royal Decree-Law 29/2026 (Spanish Tax Agency)
- Information bulletin on the tax changes in Royal Decree-Law 29/2026 (Spanish Tax Agency, October 2026)
- Sale of the main residence by people over 65, 2025 IRPF manual for over-65s (Spanish Tax Agency)
- Sale of assets by people over 65 with reinvestment in life annuities, 2025 IRPF manual for over-65s (Spanish Tax Agency)
- 2025 tax return, section F2: capital gains and losses from the transfer of real estate (Spanish Tax Agency, form 100 help)
- Data form for the sale of real estate, 2025 tax return (Spanish Tax Agency)
- Capital gains from the sale of real estate, manual on taxation of non-residents (Spanish Tax Agency)
- Changes made to IRPF by Royal Decree-Law 29/2026 of 6 October (General Council of Associations of Administrative Agents of Spain)