Selling your home to buy another carries a tax benefit many people miss because they don’t know the rules: the reinvestment exemption for the main residence. Properly applied, it means not paying IRPF on the capital gain from the sale. Incorrectly applied —or applied without meeting the requirements— it can mean a tax assessment from Hacienda years later. These are the rules of the game.
What it allows exactly
If you sell your main residence and reinvest the proceeds obtained in buying (or building) another main residence, the capital gain is exempt from IRPF in the proportion reinvested. Full reinvestment, full exemption; partial reinvestment, partial exemption. On a gain of €60,000, we’re talking about saving around €12,000 or more.
Requirement 1: that it really is your main residence
The property sold must have been your effective residence for at least 3 continuous years (except in circumstances that force a change: work relocation, marriage, separation…). And there is a key nuance: it’s considered that you sold your main residence if it was your main residence at any time within the 2 years prior to the sale — a relief for someone who already moved out before selling. The new property, in turn, must be occupied in practice within 12 months of purchase.
Requirement 2: the 2-year deadline
The reinvestment can be made in the 2 years following the sale or in the 2 years before it (yes: buying first and selling later also counts, common with new-builds). If you buy off-plan, what matters is that the legal acquisition —the delivery— falls within the period, so it’s wise to check the developer’s schedule before relying on a promised delivery for the exemption.
Requirement 3: how much must be reinvested
Not the gain: the total amount obtained from the sale (after deducting the mortgage repaid). If you sell for €200,000 with €50,000 of mortgage outstanding, the amount to reinvest for full exemption is €150,000. If the new home costs less, the exemption will be proportional.
The special case: those aged 65 and over
If you are 65 or older and sell your main residence, the gain is exempt without the need to reinvest in anything. This rule allows many local homeowners to sell a large chalet, buy something more comfortable and keep the difference free of IRPF.
How it’s applied (and the typical mistake)
The exemption is declared on the IRPF return for the year of the sale, stating the intention to reinvest. Failing to do so, or selling the new property before it has become your main residence, are the errors that end up with Hacienda on your case. Also remember that this exemption concerns IRPF: the municipal capital gains tax (plusvalía municipal) is separate and has its own rules.
Thinking of changing home? The first figure you need is how much you’ll get for your current property: we provide a free valuation based on actual sales, and we coordinate your sale with the timing of your new purchase so the exemption fits without surprises. The two years pass quickly: better to have a schedule from day one.


