Sale of the former home after a separation: when the reinvestment exemption in personal income tax is retained
The disposal of the family home after a separation, divorce or annulment raises a recurring problem under the “IRPF”, Spain's personal income tax: can the spouse who had to leave the home continue to benefit from the exemption for reinvestment in a principal residence laid down in article 38 of Law 35/2006 of 28 November on personal income tax —the LIRPF—, when he or she sells his or her share and acquires a new dwelling? The judgment of the Third Chamber of the “Tribunal Supremo”, Spain's Supreme Court, of 27 May 2026, Second Section, cassation appeal 6833/2024, confirms and consolidates the doctrine begun by STS 553/2023 of 5 May and answers in the affirmative: the spouse who leaves the home under a court decision may satisfy the occupation requirement for the exemption where the other spouse and the couple's children have continued to live there. The key lies in a systematic interpretation of the concept of principal residence in article 41 bis of the “Reglamento del IRPF” —Spain's personal income tax regulations, the RIRPF—, approved by Royal Decree 439/2007 of 30 March, and in treating the family home as the point of reference.
1.The exemption for reinvestment in a principal residence: statutory requirements
Article 38.1 of Law 35/2006 provides that capital gains obtained on the disposal of the taxpayer's principal residence may be exempt from tax, provided that the total amount obtained on the disposal is reinvested in the acquisition of a new principal residence on the conditions laid down by regulation. Where the amount reinvested is lower than the total received, only the proportionate part of the gain corresponding to the amount reinvested is excluded from taxation. The implementing provisions are in article 41 of the RIRPF, which specifies that the reinvestment must be made, in a single act or successively, within a period of no more than two years from the date of disposal of the principal residence, and that sums obtained on the sale which are applied to paying the price of a new principal residence acquired in the two years before the disposal also give rise to the exemption. The same provision requires the taxpayer to state, in the tax return for the year in which the gain is obtained, the intention to reinvest, where the reinvestment is not made in the same year as the sale.
The concept of principal residence, for the purposes of this exemption, is defined in article 41 bis of the Regulations. Paragraph 1 provides that the taxpayer's principal residence is the building that constitutes his or her residence for a continuous period of at least three years, with exceptions where circumstances arise that necessarily require a change of home, such as marriage, marital separation, relocation for work, taking up a first job, a change of job or other similar justified circumstances. Paragraph 2 requires the dwelling to be actually and permanently occupied by the taxpayer within twelve months of its acquisition or of completion of the works, with similar exceptions. Paragraph 3, which is central to the dispute, provides that, for the sole purposes of the reinvestment exemption, the taxpayer is to be regarded as disposing of his or her principal residence where, in accordance with the provisions of that article, the building is his or her principal residence at that time or had that status up to any day within the two years preceding the date of disposal.
2.Separation, divorce and the award of the use of the family home
Where a marriage breaks down, the use of the family home is awarded in accordance with article 96 of the “Código Civil” —the Spanish Civil Code—. That provision states that, in the absence of an agreement between the spouses approved by the court, the use of the family home and of the objects for ordinary use in it is to go to the couple's minor children and to the spouse in whose company they remain, until they all reach the age of majority, with specific rules for children with disabilities and for cases where there are no children. Article 90 of the Civil Code, in setting out the minimum content of the “convenio regulador” —the court-approved separation agreement—, includes the award of the use of the home and of the household effects as one of the matters that must be agreed and submitted for judicial approval. In practice, this means that, in many cases, one of the spouses leaves the family home as required by the separation or divorce judgment, while the other spouse and the children remain there.
From a civil-law standpoint, the dwelling remains the family home, even though one of the spouses no longer lives there. From a tax standpoint, the question is whether the spouse who leaves the home automatically loses its status as a principal residence for the purposes of article 38 LIRPF and article 41 bis RIRPF, or whether he or she may still be regarded as disposing of a principal residence when, years later, the co-ownership is terminated and he or she sells his or her share, reinvesting in a new dwelling.
3.The Supreme Court's doctrine: a systematic interpretation of article 41 bis RIRPF
STS 553/2023 of 5 May, Third Chamber, Second Section, decided this question for the first time in a case in which the taxpayer had left the family home in 2012 under a divorce judgment awarding its use to the former spouse and the couple's children, and in 2015 the co-ownership was terminated, the former spouse acquiring the whole of the property and paying financial compensation to the appellant, who reinvested the entire amount received in the acquisition of a new principal residence. The tax authorities refused the reinvestment exemption on the ground that the dwelling disposed of had ceased to be the taxpayer's principal residence more than two years before the disposal, a view upheld by the “Tribunal Económico-Administrativo Regional” —the regional tax tribunal, or TEAR— and by the “Tribunal Superior de Justicia” of Andalucía —the High Court of Justice, or TSJ—. Allowing the appeal, the Supreme Court laid down the doctrine that, in situations of separation, divorce or annulment, the requirement of actual occupation of the dwelling at the time of the disposal or in the two preceding years is treated as satisfied for the spouse who had to leave the home, provided that the dwelling has continued to be the principal residence of the spouse who remained in it.
The STS of 27 May 2026, appeal 6833/2024, confirms and consolidates that doctrine. The Chamber reasons that the concept of principal residence in article 41 bis RIRPF must be interpreted systematically, reading all its paragraphs together. Paragraphs 1 and 2 place the spouse who must leave the home because of a separation on the same footing as the one who stays, by treating marital separation as a circumstance that necessarily requires a change of home and by allowing the dwelling to keep its status as a principal residence even though the taxpayer ceases to live there for such reasons. Paragraph 3, in referring to “lo dispuesto en este artículo” (as provided in this article) in order to determine when the taxpayer is to be regarded as disposing of a principal residence, must be interpreted consistently with that equal treatment. Paragraph 3 cannot be read in isolation so as to require actual occupation by the disposing spouse in the two preceding years, disregarding the fact that the article itself recognises that the dwelling may continue to be a principal residence even though the taxpayer leaves it because of a separation.
The Court stresses that the family home is a shared reality and that the protection afforded by the reinvestment exemption cannot depend on the spouse required to leave the home formally losing the status of occupant. A restrictive reading requiring actual occupation by the disposing spouse in the two preceding years would penalise the spouse who is forced to leave the home by court order, giving rise to unequal and unjustified treatment contrary to the principles of equality in article 14 of the Constitution and of ability to pay in article 31.1. The Chamber concludes that, where the dwelling has continued to be the principal residence of the other spouse and of the couple's children, the spouse who leaves it because of a separation, divorce or annulment may still be regarded as disposing of a principal residence for the purposes of article 38 LIRPF and article 41 bis RIRPF.
4.When the dwelling retains its status as a principal residence for tax purposes
In the light of that doctrine, the dwelling retains its status as a principal residence for tax purposes for both spouses where, before the separation, it met the requirements of actual occupation and permanence in article 41 bis RIRPF and, after the separation, it continues to be the principal residence of the spouse who stays there and of the couple's children. The spouse who leaves the home is not required to go on living there; it is enough that the dwelling keeps its character as the family home and as a principal residence for the family unit. Marital separation is regarded as a circumstance that necessarily requires a change of home, so that the spouse who leaves it does not thereby lose the benefit of the exemption when, years later, he or she disposes of his or her share.
The time requirement in paragraph 3 of article 41 bis, which calls for the dwelling to be the taxpayer's principal residence at the time of the disposal or to have been so up to any day within the two preceding years, is interpreted as meaning that the dwelling must have been the principal residence of the family unit, not necessarily of the disposing spouse, up to any day within the two preceding years. If the other spouse and the children have continued to live in the dwelling until the disposal or until any day within the two preceding years, the requirement is treated as satisfied for the spouse who left it.
5.Time limits for selling and reinvesting
The time limits for selling and reinvesting are not altered by the separation. Article 41 RIRPF maintains the two-year period from the disposal for making the reinvestment, or the two years before the disposal if the new dwelling has been acquired earlier. The practical point is that, in many cases, the disposal of the former family home takes place years after the separation, when the co-ownership is terminated or the common property is wound up. The Supreme Court's doctrine allows the exemption to apply even though more than two years have passed since the spouse left the home, provided that the dwelling has continued to be a principal residence for the other spouse and the children up to any day within the two years preceding the disposal. The relevant period is that for reinvestment measured from the date of disposal, not the time elapsed since the separation.
6.Proving that the other spouse remained and that the dwelling was a principal residence
Applying the exemption calls for evidence that the dwelling has kept its status as a principal residence for the family unit. The judgment of 27 May 2026 insists on the importance of evidence, although in the case at hand the fact that the former spouse and the children had remained in the dwelling was established by the divorce judgment itself and by the documents produced. In practice, the company or the taxpayer must be able to establish, by means of the separation or divorce judgment, the court-approved “convenio regulador”, the “empadronamiento” (registration on the municipal roll of inhabitants), utility bills, correspondence and any other indication, that the other spouse and the children have continued to live in the dwelling until the disposal or until any day within the two preceding years.
The tax authorities may question the exemption if they take the view that the dwelling has ceased to be a principal residence, for example if the other spouse and the children have moved to another dwelling and the former one has been left empty or let to third parties. In such cases the burden of proof falls on the taxpayer, in accordance with article 106 of the “Ley General Tributaria” —Spain's general tax act, the LGT—, which requires the facts giving rise to the right to the exemption to be established. The Supreme Court's doctrine does not remove the need for evidence; it simply extends the concept of occupation to cover the family unit remaining in the dwelling.
7.Problems in winding up the common property and in terminating the co-ownership
The sale of the former family home usually takes place in the context of winding up the common property or terminating the co-ownership between the spouses. From a civil-law standpoint, terminating the co-ownership by allotting the dwelling to one of the spouses with financial compensation to the other may be regarded, in certain cases, as a division of jointly owned property that does not generate a capital gain, in accordance with article 33.2 a) of Law 35/2006, which provides that there is deemed to be no change in the composition of a person's assets in cases of division of jointly owned property, dissolution of the “sociedad de gananciales” —the Spanish community-property regime— or termination of the participation-in-acquisitions matrimonial property regime, and dissolution of co-ownerships of assets or withdrawal of a co-owner, and that such cases may not give rise to any revaluation of assets. However, where the allotment involves an excess allotment in favour of one of the spouses, compensated financially, there may be a capital gain for the other, and the reinvestment exemption may be relevant.
The civil and tax case law has analysed these situations in detail, distinguishing between mere winding-up transactions with no excess allotment and transactions that conceal disposals for consideration. The STS of 27 May 2026 concerns a case of termination of a co-ownership with financial compensation, in which the tax authorities took the view that there was a capital gain and refused the reinvestment exemption. Without going into the characterisation of the transaction as a disposal, the Chamber confines itself to stating that, once the existence of a capital gain is accepted, the reinvestment exemption applies if the principal-residence and reinvestment requirements are met, interpreted in accordance with its doctrine.
8.Conclusion: protection of the family home and legal certainty for the spouse who leaves it
The STS of 27 May 2026, in line with STS 553/2023 and with the Third Chamber's official report for 2025–2026, strengthens the protection of the family home in tax matters and provides legal certainty for the spouse who is forced to leave the home because of a separation, divorce or annulment. The exemption for reinvestment in a principal residence under article 38 LIRPF is not automatically lost by ceasing to live in the dwelling, where the dwelling continues to be the principal residence of the other spouse and of the couple's children. A systematic interpretation of article 41 bis RIRPF and the treatment of separation as a circumstance that necessarily requires a change of home make it possible to keep the status of principal residence for the purposes of the exemption.
At the same time, applying the exemption requires compliance with the reinvestment time limits in article 41 RIRPF and evidence that the family unit remained in the dwelling until the disposal or until any day within the two preceding years. Winding up the common property and terminating the co-ownership may raise questions of characterisation in civil and tax law, but the Supreme Court's doctrine offers a clear criterion as regards the principal residence. In short, the sale of the former home after a separation does not in itself preclude the reinvestment exemption under the IRPF, provided that the dwelling has continued to be the family home and that the amount obtained is reinvested in a new principal residence within the statutory time limits and conditions.