The exemption for reinvesting the proceeds of your main home in another one is one of the few features of Spanish personal income tax, the IRPF, that can bring a six-figure gain down to zero. It is also one of the most often lost over a detail: not because the seller sold badly or bought too late, but because they could not prove something that was true. Article 38.1 of Ley 35/2006, the IRPF Act, states it in a single line, and article 41 of the IRPF Regulations (the Reglamento) develops it. Between them they produce four conditions that must all be met at once. If a single one fails, the whole gain goes back into the savings base and is taxed.
The four, one line each
| # | Condition | Where it lives |
|---|---|---|
| 1 | What you sell has to be your main home | Art. 41 bis of the IRPF Regulations |
| 2 | What you buy has to be your main home as well | Art. 41 bis, with the twelve-month occupation deadline |
| 3 | You have to reinvest the total amount obtained, or reinvest part and accept a proportional exemption | Art. 38.1 of the IRPF Act and arts. 41.2 and 41.3 of the Regulations |
| 4 | Everything inside the two-year window, and declared | Arts. 41.3 and 41.4 of the Regulations |
What follows goes through the four with the question that really matters in each case. That question is not "do I meet it?" but "what do I prove it with if someone asks me three years from now?".
Condition 1: the home you sell
Not every house you have lived in qualifies. The Regulations require the building to have been your residence for a continuous period of at least three years, and that you actually and permanently moved in within the twelve months following its purchase or the completion of the building works. Three years of residence and twelve months to move in: two separate clocks, and both of them count.
There is a grace rule that rescues many cases and that almost nobody knows about. For this exemption, you are treated as selling your main home when it was your main home at the time of the sale, or when it had been your main home up to any day within the two years before the date of the transfer. That is the route in for someone who moved out, took a while to find a buyer and signed eighteen months after leaving.
The beach apartment, the flat you inherited and let out, the one you bought for your children, the converted shop unit where you never registered on the padrón (the municipal register of residents): none of them gives a right to this exemption, however much of a home it may be. Registering on the padrón three months before selling does not do it either. It gets checked, and it gets checked against data the tax authorities already hold. If that is your situation, this is not the route: the route is to calculate the gain properly and see which other rules come into play.
The circumstances that release you from the three-year period are listed in article 41 bis itself: death, marriage, marital separation, a job transfer, getting a first job or a better one, and other similar justified circumstances. They have their own guide in how to prove it was your main home. What is worth keeping in mind here is that these are circumstances that require the change of address, not ones that merely make a move attractive.
Condition 2: the home you buy
The second condition is forgotten more often than the first, because the buyer is thinking about paying and not about the tax return. The new home also has to become your main home: you have to move in actually and permanently within the twelve months following the purchase or the completion of the works, and keep it as your residence for the continuous three-year period.
That means three uncomfortable things:
- Buying and letting it out does not work. If the new property is let from day one, it is not your main home and the exemption falls away, however fully the sale proceeds went into the purchase.
- Buying and leaving it empty does not work either. A second home used in August does not meet the requirement of actual and permanent occupation.
- The commitment outlives the return. You claim the exemption in the tax return for the year of the sale, but the three years of living in the new house are used up later. A review arriving in the fourth year can look back and ask about them.
Buying the new home with borrowed money does no harm. The law does not require you to pay cash; it requires you to reinvest the amount obtained. Someone who sells for €300,000 and buys for €400,000 with a mortgage has reinvested the amount obtained if that money went into the purchase, with the mortgage covering the rest.
Condition 3: the amount, which is not the gain
This is where the most expensive mistake is made. What has to be reinvested is not the gain you made. It is the total amount obtained on the sale. They are two completely different figures, and the second one is always the larger.
| Item | Amount (€) |
|---|---|
| Sale price | 320,000 |
| Selling costs borne by the seller | −6,800 |
| Updated acquisition value (purchase plus the costs and taxes paid at the time) | −210,000 |
| Capital gain | 103,200 |
| Amount that has to be reinvested | 313,200 |
Someone who reinvests €103,200 thinking they are reinvesting "the gain" will have reinvested a third of what they should have, and will get a partial exemption of roughly a third. The full arithmetic, including the effect of a mortgage loan paid off out of the sale, is in how the amount to reinvest is calculated, which is the guide to read with a calculator next to you.
Article 41.1 of the Regulations puts it plainly: where the amount reinvested is lower than the total obtained, only the proportional part of the gain matching the amount actually reinvested is exempt. Reinvesting 60 % of the amount exempts 60 % of the gain. It is not all or nothing, which is why reinvesting something is always better than giving up.
Condition 4: the deadline, and the return
The reinvestment has to be made in one go or in stages, over a period of no more than two years. And those two years run in both directions: a purchase in the two years before the sale counts just as much as a purchase in the two years after it. Buying first and selling afterwards is a perfectly valid scheme, and in practice it is the most common one.
The fourth condition has a leg that is formal rather than material: the reinvestment, including the one you have not made yet but intend to make, must be stated in the tax return for the year in which the gain arises. Someone who sells, buys the following year and ticks nothing in any return has met the first three conditions and failed the fourth. The two guides that develop this are the two-year window in detail and how to claim it, and what happens if something fails.
Three real cases from our files, in short
| Situation | Where the problem was | What could be done |
|---|---|---|
| Sale in March, purchase in November of the following year, nothing declared | Condition 4: the exemption was not entered in the return for the year of the sale | Correction of the self-assessment within the limitation period, arguing that the exemption is not an irrevocable election. It is arguable; it is not certain |
| Exactly the amount of the gain was reinvested | Condition 3: the gain was confused with the amount obtained | Proportional exemption on what was actually reinvested, and evidence of later payments still within the two years |
| The new home was let for two years before the owner moved in | Condition 2: it never became the main home within twelve months | Little room. We examined whether any circumstance justified the delay; there is not always one |
All three share one feature: the problem was not discovered at the sale but two or three years later, when the letter arrived. That is why the useful work is done before signing, not after the letter comes in.
When none of this has to be met
Before setting up a reinvestment, it is worth checking whether the case is exempt through another door. Article 33.4.b) of the IRPF Act takes out of tax the gain on the sale of a main home by people over sixty-five, and also by people in a situation of severe dependency or high dependency under Spain's long-term care legislation. That exemption asks for no reinvestment, has no two-year window and does not oblige you to buy another house: it is enough that the property sold is your main home.
There is also a third route, in article 38.3, designed for someone over sixty-five who sells any asset (not necessarily the home) and reinvests the proceeds in setting up an insured lifetime annuity in their own favour. It has its own deadline, its own conditions and a maximum amount set by the law itself, which should be checked against the text in force before you count on it. These are three different mechanisms that sometimes overlap for the same taxpayer, and choosing the one that suits best is part of the work to be done before signing.
What we do not say
No reading of these four conditions guarantees the outcome. The tax authorities check facts (where you lived, when, with what utility consumption, what you paid and when) and nobody can give assurances about facts in advance. What can be done is to put the file in order before there is a file: gather the deeds, the bank's certificate of outstanding debt, the history of your padrón registration and the utility bills, and see whether the case holds up. When it does not, it is better to know on the day of the sale than three years later.
We are tax lawyers and we handle the matter from start to finish: the calculation, the entry in the return and the reply if a request for information arrives. If you would like us to look at it with your papers in front of us, tell us about the case in the reinvestment form, or first read the page on main home reinvestment, where the general picture of the relief is set out.