Raúl Méndez, a telecommunications engineer, bought a flat in Benimaclet, in Valencia, on 1 May 2024 and moved in as soon as he was given the keys. In January 2026 his company closed its Valencia office and offered him the choice of continuing at its Madrid headquarters or leaving. He accepted the transfer, settled in Getafe, near Madrid, and sold the flat on 1 June 2026, twenty-five months after buying it. He made a gain of 27,000 €. A colleague told him that, as he had not managed to live there for three years, the reinvestment exemption does not apply and he will have to pay tax. That is only half the story.
Where the three years come from
Article 41 bis.1 of the Regulations on IRPF (Spanish personal income tax) defines the main home as the building that constitutes the taxpayer's residence "for a continuous period of at least three years". The definition applies to the reinvestment exemption in article 38 of the Law, to the exemption for people over 65 and to other exemptions. Without that requirement, in principle, the home is not a main home and its sale cannot benefit from reinvestment.
The count has its own rule. Under section 2 of the same article, if the home is effectively lived in within the twelve months following its acquisition or the completion of the building work, the three years are counted from the acquisition or completion. Raúl bought and moved in the same month, so his period started on 1 May 2024 and would have ended on 1 May 2027.
The exception: when the move is forced
The second paragraph of article 41 bis.1 qualifies the rule. The home counted as the main home, even though three years have not passed, when the taxpayer dies "or other circumstances arise that necessarily require a change of address". The Regulations themselves give examples: marriage, marital separation, transfer for work, getting a first job or changing jobs, "or other similar justified circumstances".
The key word is "necessarily". It is not enough for the change to be convenient, reasonable or to improve the taxpayer's life. There has to be a cause that, in practice, forces you to leave the home. Raúl's transfer 350 kilometres away is the textbook example.
| Situation | Fit with article 41 bis.1 |
|---|---|
| Transfer for work to another city | Case expressly mentioned |
| First job, or a change of job that requires moving | Case expressly mentioned |
| Marriage | Case expressly mentioned |
| Marital separation | Case expressly mentioned |
| Death of the taxpayer | Case expressly mentioned |
| Illness or disability that makes the home unsuitable | Can be argued as similar if justified |
| Birth of a child and lack of space | Disputed; depends on the real need and its proof |
| Chance to sell at a good price, or wish for a bigger house | Does not fit: it is a voluntary decision |
"Similar" situations have no closed list and each case is judged on its facts. We cannot guarantee how Hacienda, as the Spanish tax office is commonly called, will assess a cause that does not appear in the text; what we can do is organise the evidence so that the need can be seen.
What Raúl has to prove
A transfer for work is a case provided for, but the burden of proving it still lies with the taxpayer. In his case we would gather:
- The company's notice of the closure of the Valencia office and the offer of a transfer.
- The annex to the contract or the letter assigning him to Madrid, with the date he starts.
- His Social Security employment history or a company certificate, to show that his workplace changed.
- The distance between the flat in Benimaclet and the new workplace, which makes a daily commute unworkable.
- The padrón (the town hall's register of residents) and the utilities for the Valencia flat up to the move, which show that it was his real residence.
The timing between the cause and the move carries a lot of weight. If Raúl had sold two years after the transfer, the sale would no longer look like a consequence of it, and he would also run into another limit: the flat is only regarded as the main home if it was so until some day in the two years before the sale (article 41 bis.3).
Getting past the three years in the home sold is only half the requirement. The new home in which the money is reinvested also has to become the main home: moving in within twelve months and living there for three years, unless another circumstance forces a move again. If Raúl leaves the house in Getafe after a year without a cause that requires it, he loses the exemption on the Valencia sale and has to correct the 2026 tax year.
Raúl's figures
- Purchase price in 2024 plus costs: 190,000 + 15,000 = 205,000 €.
- Transfer value in 2026, after deducting the costs of the sale: 232,000 €.
- Gain: 232,000 − 205,000 = 27,000 €.
- Mortgage outstanding on the day of the sale: 140,000 €.
- Total amount obtained: 232,000 − 140,000 = 92,000 €.
- He buys in Getafe in September 2026 and puts 92,000 € towards the price.
- If the transfer is accepted as the cause, the 27,000 € gain is fully exempt.
If it were not accepted, the 27,000 € would be taxed in the 2026 savings base. The amount of tax depends on Raúl's other income and on the scale in force, so we do not give it here; what matters is that the dispute concerns the whole gain and not just part of it.
And if the stay was shorter but there is no cause?
Consider Raúl's cousin, Elena, who bought in Paterna, near Valencia, in 2024 and sold in 2026 because she found a detached house she liked more. There is no transfer, no marriage, no separation. Her flat does not reach main home status and the exemption does not apply, however much she reinvests in the detached house. For her, the only useful decision would have been to wait until the three years were up before signing the sale, if the market allowed it.
That is why it is worth reviewing the dates before putting the home up for sale, not afterwards. One month's difference can separate an exempt gain from a gain that is taxed in full. On the reinvestment form you can tell us the dates of purchase, occupation and planned sale, and the cause that is making you move.
The case of marriages and separations
Two of the cases mentioned have to do with the family. Someone who marries and goes to live in their spouse's home before completing three years in their own may keep the exemption on their previous home. And someone who separates and leaves the shared home also has a cause provided for, with its own nuances about who keeps the home and which date counts, which we deal with in I got divorced and moved out.
How actual residence is proved is covered in what exactly "main home" means and, in more documentary detail, in the guide on how to prove your main home. If you are also over 65, the same definition and the same exception apply to the exemption without reinvestment, as we explain in I am over 65: do I need to reinvest?.
Reviewing the three-year requirement, the cause of the move and its proof is part of the Salama Tax service on selling your main home, which also sets out the time limits for each step.