Skip to content

The two-year window

I got divorced and moved out: is it still my main home?

For two years from when you left, yes, for the purposes of the exemption. After that, your half is no longer your main home even if your children still live in it.

Daniel Ortiz and Marta Rey bought a flat in the Pumarín district of Oviedo in 2018, under the gananciales regime (Spain's community of property between spouses). They separated and in February 2024 Daniel moved out; Marta stayed in the flat with their two children. The convenio regulador (the separation agreement approved by the court), approved in June 2024, provides for the flat to be sold when the elder child finishes the school year and for the money to be shared out. Meanwhile, in April 2025 Daniel bought a small flat in the town centre, where he has lived since then. The buyer they have found wants to sign in May 2026. Daniel wants to know whether his half is still his main home for the purposes of the reinvestment exemption, and whether the flat he has already bought can be used for reinvestment.

What the Regulations provide for separation

Article 41 bis of the Regulations on IRPF (Spanish personal income tax) mentions marital separation twice, although with different effects. In section 1, separation is one of the circumstances that "necessarily require a change of address" and allow a home in which three years of residence have not been completed to be regarded as the main home. In Daniel's case he does not need that: he lived in Pumarín for almost six years.

What affects him is section 3: for the purposes of the reinvestment exemption and the over-65 exemption, the taxpayer is regarded as transferring their main home when the home is the main home at the time of the sale "or had been regarded as such until any day in the two years before the date of transfer". For someone who leaves the home, the clock starts on the day they stop living there.

Which date counts

Daniel has three dates in his story: moving out in February 2024, the agreement approved in June 2024 and the later divorce. The one that governs the main home is the first, because the main home is a fact: the place where you actually live. On the day Daniel stopped sleeping in Pumarín it stopped being his residence, even though the agreement came months later.

That date needs to be well proved: the change of padrón registration (the town hall's register of residents), the rental contract or the deed for the new home, the court application or the agreement describing the departure, the change of tax address. If the departure is not documented, Hacienda, as the Spanish tax office is commonly called, may take another date, and the two-year margin moves with it.

Some argue for another reading

There is an argument that the home would remain the main home for the spouse who leaves while the children occupy it by court decision, because the departure is not voluntary but imposed by the break-up. It is an idea with some logic, but the text of article 41 bis refers to the actual residence of the taxpayer themselves, and we do not treat it as safe for the reinvestment exemption. The rule that can be applied with confidence is the two-year one.

The figures depending on the date of the sale

The flat is sold for a transfer value, after costs, of 280,000 €. It cost 200,000 € with its costs and 90,000 € of mortgage remains. Each of them owns half:

  1. Transfer value for each: 140,000 €.
  2. Acquisition value for each: 100,000 €.
  3. Gain for each: 40,000 €.
  4. Outstanding mortgage attributable to each: 45,000 €.
  5. Total amount obtained by each: 140,000 − 45,000 = 95,000 €.

And now the date:

ScenarioFor MartaFor Daniel
Sale in January 2026 (less than two years since he left)Main home: she can apply reinvestmentMain home under art. 41 bis.3: he can apply reinvestment
Sale in May 2026 (more than two years since he left)Main home: she can apply reinvestmentNo longer his main home: his 40,000 € are taxed

For Daniel, the difference between signing in January or in May is his entire gain. For Marta nothing changes, because she is still living in the flat.

The agreement's calendar is not the tax calendar

Many separation agreements set the sale of the family home for when the children finish a stage of school or reach a certain age. That date makes sense for the family, but it may fall after the two years in article 41 bis.3 for the spouse who left. If the agreement is still being negotiated, it is worth bearing in mind; if it has already been signed, it is worth measuring how much waiting costs. We do not guarantee that Hacienda will accept another approach if the sale is signed outside the period.

The flat Daniel bought earlier

Daniel bought his flat in the centre in April 2025 and lives in it. If the sale of the Pumarín flat were signed in January 2026, that flat would fall within the two years before the sale, and what was obtained could be used to pay its price, for example by paying off the loan with which he bought it. This is the situation in I bought the new home before selling the old one, with its requirements of proof about where the money went.

If the sale is signed in May 2026, the problem is not the new flat but the old one: as it is no longer his main home, there is no exemption to apply, even if he reinvests the 95,000 €.

The alternative of allocating the flat to one of them

Many couples do not sell to a third party; instead, one of them keeps the home when the gananciales community is wound up. Article 33.2.b) of the IRPF Law provides that there is no change in assets on the dissolution of the community of property. If Marta is allocated the flat and Daniel receives other assets of equivalent value, neither of them declares a gain at that point, and Marta keeps the 2018 acquisition date and value for when she sells.

When the allocation does not match each person's share and is balanced with money, the transaction may have different tax consequences that have to be analysed with the division document in front of you. Here too it is best not to take anything for granted: the wording of the settlement matters. If the home is owned by both in ordinary co-ownership, not under gananciales, the applicable rule is the one on dividing jointly owned property in the same article 33.2, with its own nuances, which are reviewed with the deed ending the co-ownership.

Separation also protects the new home

There is one last common situation. Someone who sells their home, reinvests in another with their partner and separates a few months later has to leave the new home before completing three years. Separation is precisely one of the circumstances that article 41 bis.1 accepts for not requiring that period. With that support, the exemption on the earlier sale should not be lost because of the departure, provided the separation is proved and the move is a consequence of it; even so, it is a point Hacienda may review. We develop this in I have not lived in the house for three years.

To review the dates of your departure, the agreement and the planned sale, you can send us the paperwork through the reinvestment form. With the agreement and the historical padrón it is quickly clear whether the sale is within the margin. The time limits in general are in the two years: from when and until when, and proof of residence in the guide on how to prove your main home.

Sales of the family home after a separation, with the gain and the mortgage shared between the two, are studied in the Salama Tax service for selling your main home.

Let us take your reinvesting in a new home on

We read the case, file the returns and show you the figures first.

Start here
Book a callWhatsApp