Question. I purchased a home in Gijón before selling the one I owned in San Fernando (Cádiz), generating a capital gain of 38,000 euros. Can I deduct the acquisition cost of the new home as a reinvestment in a primary residence, even though I bought it a year earlier? Ana M. Carbajales

Answer. We start from the premise that both the home in San Fernando (Cádiz) and the one in Gijón qualify as a primary residence. In that case, the exemption for reinvestment in a primary residence could indeed apply, provided that the requirements set out in the Personal Income Tax (IRPF) regulations are met. The law allows this exemption both when the new home is acquired after selling the previous one and when the purchase is made beforehand.

Specifically, the reinvestment may take place within the two years prior to or the two years following the transfer of the primary residence. Therefore, if you purchased the home in Gijón one year before selling the one in San Fernando, and both qualify as a primary residence, you will be able to benefit from the reinvestment exemption.

However, the exemption does not depend solely on the amount of the capital gain obtained (38,000 euros), but on the total amount received from the sale of the home. For the exemption to be total, the entire transfer value must be reinvested — that is, the amount received from the sale after deducting any outstanding mortgage capital on the property, if applicable, and the expenses and taxes associated with the transaction. If the amount reinvested is lower, the exemption will be partial, in proportion to the amount actually reinvested.

Regarding the IRPF tax return, the exemption must be applied in the tax year in which the sale of the home takes place, as this is the moment when the capital gain arises.

In short, if the home in Gijón was purchased one year before the sale of the home in San Fernando and all other legal requirements are met, you will be able to benefit from the reinvestment exemption for primary residences when filing the IRPF return corresponding to the tax year in which you transferred the property in Cádiz.

If you have questions, suggestions, or simply wish to share your situation with us, you can send us an email at vivienda@elpais.es.

The data you provide will be processed by EDICIONES EL PAÍS, S.L.U., (C/ Miguel Yuste, 40, 28037-Madrid), for the purpose of handling your queries and/or testimonials and producing informational content. You may exercise your rights recognized under data protection regulations by contacting dpo@prisa.com, providing proof of identity and specifying the right you wish to exercise. For more information, please consult the Privacy Policy.