The General Directorate of Taxes (DGT), an organization dependent on the Ministry of Finance, has clarified that a taxpayer can apply the exemption for reinvestment in a habitual residence even if they have purchased their new home before selling the previous one. This is stated in the binding consultation V0720-26, of March 30, 2026, in which it analyzes the case of a woman who, together with her partner, acquired a new home in July 2025 and sold her previous one. habitual residence in December of that same year.
The main question was whether he could apply the personal income tax exemption for the capital gain obtained from the sale of his former habitual residence, taking into account that the new house had already been purchased before and that the operation had been financed through a mortgage loan. The Treasury responds that it can be applied, as long as all the requirements demanded by the regulations are met.

The National Court endorses that the Treasury collects personal income tax if there are indications that severance payments act as a ‘bridge’ to retirement

Hit to the Treasury: they will have to return more than 60 million euros to Shakira after eight years of tax litigation
Specifically, the exemption analyzed is that of article 38.1 of the Personal Income Tax Law, developed by article 41 of the Personal Income Tax Regulations, which allows the gain obtained from the sale of the primary residence to be exempt when the amount obtained is reinvested in the acquisition of a new primary residence. That is, the taxpayer can avoid paying personal income tax on that gain if he uses the money to buy another home that will also be his habitual residence.

Treasury allows you to buy first and sell later
In its analysis, the DGT explains that reinvestment does not necessarily have to be done after selling the old home. The regulations allow the reinvestment to be carried out within a period of two years before or after the date of transmission.
This means that the taxpayer can first buy the new primary residence and then sell the previous one without losing the exemption, as long as both operations occur within that time frame. In the case analyzed, the consultant bought the new home in July 2025 and sold the previous one on December 11, 2025, so the acquisition was made within two years prior to the sale.
To justify this, Taxes relies on article 41 of the Personal Income Tax Regulations, which establishes that the amounts obtained from the sale that are used to pay for a new habitual residence acquired in the two years prior to the transfer also qualify for exemption.
Furthermore, the Treasury reminds that the home sold must be considered a habitual residence at the time of sale or have had one on any day of the previous two years, according to article 41 bis of the Personal Income Tax Regulations. This point is important because the exemption does not apply to any property, but only to the taxpayer’s habitual residence.
It is not necessary to use exactly the same money from the sale
Another of the most relevant points of the consultation is that the Treasury clarifies that it is not mandatory that the money obtained from the sale of the old home be exactly the same as that used to buy the new one. The important thing is that the taxpayer has invested an equivalent amount in the new habitual residence within the legal period.
The DGT cites for this a resolution of the Central Economic-Administrative Court (TEAC), of September 11, 2014, which establishes that reinvestment does not require a total identity between the money received from the sale and the money used in the purchase. This is because money is a fungible good, that is, it does not matter whether they are the same bills or the same transfer, but rather that an equivalent amount has been allocated to the acquisition of the new home.
In practice, this allows the taxpayer to purchase the new home with savings, a mortgage or third-party financing and then sell the old home. If the amount invested in the new primary home is equivalent to the amount obtained from the sale, the gain may be totally exempt.
The DGT also relies on a ruling from the Supreme Court of October 1, 2020, which established as a doctrine that it is not necessary to use the money obtained from the sale of the previous home in its entirety, and it is sufficient to apply money borrowed for the same purpose, as occurs with a mortgage.
