El contexto: una exención que Hacienda siempre negó a los expatriados
Context: an exemption that the Tax Agency always denied to expatriates
La exención por reinversión en vivienda habitual está regulada en el artículo 38 de la Ley del IRPF y en el artículo 41 bis del Reglamento. Permite que la ganancia patrimonial obtenida por la venta de la vivienda habitual quede exenta del IRPF, siempre que el importe obtenido se reinvierta en la adquisición de una nueva vivienda habitual en el plazo de dos años.
The reinvestment exemption on main residence is regulated in Article 38 of the Personal Income Tax Law and Article 41 bis of the Regulations. It allows the capital gain from the sale of a main residence to be exempt from IRPF, provided the proceeds are reinvested in a new main residence within two years.
El problema clásico de los expatriados era el siguiente: un trabajador residente en España es trasladado por su empresa al extranjero. Vende su piso en Madrid, se marcha y reinvierte en una vivienda en el nuevo país de destino. La Agencia Tributaria denegaba sistemáticamente la exención argumentando que el contribuyente ya no era residente fiscal en España en el momento de la reinversión, o que la nueva vivienda no estaba en territorio español.
The classic problem for expatriates was as follows: a worker resident in Spain is transferred by their company abroad. They sell their flat in Madrid, leave and reinvest in a property in the new destination country. The Tax Agency systematically denied the exemption arguing that the taxpayer was no longer a tax resident in Spain at the time of reinvestment, or that the new property was not in Spanish territory.
La doctrina del Tribunal Supremo de 2023 y cómo la consolida el TEAC en 2026
The 2023 Supreme Court doctrine and how the TEAC consolidates it in 2026
El punto de inflexión fue la Sentencia del Tribunal Supremo de 5 de mayo de 2023 (recurso 1816/2020). El Alto Tribunal estableció que la exención por reinversión en vivienda habitual es aplicable a los no residentes cuando la venta se produce como consecuencia directa de un traslado laboral al extranjero, siempre que se cumplan los demás requisitos formales.
The turning point was the Supreme Court ruling of 5 May 2023 (appeal 1816/2020). The High Court established that the reinvestment exemption on main residence applies to non-residents when the sale occurs as a direct consequence of a job relocation abroad, provided the other formal requirements are met.
El argumento del TS fue que la Disposición Adicional Séptima de la LIRNR equipara a los residentes en la UE con los residentes fiscales en España a efectos de determinadas exenciones del IRPF, entre las que se incluye la del artículo 38. Y que negar esta exención a quien se ve obligado a marcharse por razones laborales supone una restricción injustificada a la libre circulación de trabajadores protegida por el Derecho de la Unión Europea.
The Supreme Court's argument was that the Seventh Additional Provision of the LIRNR equates EU residents with Spanish tax residents for the purposes of certain IRPF exemptions, including that of Article 38. And that denying this exemption to someone who is forced to leave for work reasons constitutes an unjustified restriction on the free movement of workers protected by EU law.
Las resoluciones del TEAC de enero y abril de 2026 han dado un paso más, fijando criterio vinculante para toda la Administración tributaria en tres puntos clave:
The TEAC rulings of January and April 2026 have gone a step further, establishing binding criteria for the entire tax administration on three key points:
| Criterio TEAC 2026 | TEAC 2026 criterion | Posición anterior de Hacienda | Previous Tax Agency position | Cambio | Change |
|---|---|---|---|---|---|
| La exención es aplicable aunque el contribuyente sea no residente fiscal en España en el momento de la venta | The exemption applies even if the taxpayer is not a tax resident in Spain at the time of sale | Denegación sistemática si el contribuyente ya había adquirido residencia fiscal en el extranjero | Systematic denial if the taxpayer had already acquired tax residency abroad | Favorable al contribuyente | Favourable to taxpayer |
| La reinversión puede realizarse en una vivienda en otro país de la UE/EEE | Reinvestment can be made in a property in another EU/EEA country | La nueva vivienda debía estar en territorio español | The new property had to be in Spanish territory | Favorable al contribuyente | Favourable to taxpayer |
| El plazo de dos años para reinvertir se computa desde la fecha de venta, no desde el traslado | The two-year reinvestment period runs from the date of sale, not from the relocation | Criterio variable y poco uniforme en las distintas delegaciones | Variable and inconsistent criteria across different regional offices | Clarifica y unifica | Clarifies and unifies |
¿A quién afecta y en qué situaciones concretas aplica?
Who is affected and in what specific situations does it apply?
La doctrina TEAC 2026 afecta principalmente a trabajadores españoles (o residentes en España) que han sido desplazados al extranjero por su empresa y que han vendido o están pensando en vender su vivienda habitual en España. Es aplicable en los siguientes supuestos:
The TEAC 2026 doctrine mainly affects Spanish workers (or residents in Spain) who have been relocated abroad by their company and who have sold or are considering selling their main residence in Spain. It applies in the following situations:
- Venta de la vivienda habitual en España producida después del traslado laboral al extranjero, cuando el contribuyente ya tiene residencia fiscal fuera de España.
- Sale of the main residence in Spain made after the job relocation abroad, when the taxpayer already has tax residency outside Spain.
- Venta producida durante el año del traslado, en el período en que el contribuyente puede estar en una situación de doble residencia fiscal.
- Sale made during the year of relocation, in the period when the taxpayer may be in a dual tax residency situation.
- Contribuyentes residentes en países de la UE o del EEE que pueden invocar la Disposición Adicional Séptima de la LIRNR.
- Taxpayers resident in EU or EEA countries who can invoke the Seventh Additional Provision of the LIRNR.
La exención exige que el traslado sea de naturaleza laboral y que esté debidamente acreditado. No es suficiente con marcharse voluntariamente a vivir al extranjero: se requiere un contrato o desplazamiento empresarial documentado. La carga de la prueba recae sobre el contribuyente, y la AEAT puede requerir documentación específica en un procedimiento de comprobación.
The exemption requires the relocation to be of a work nature and to be properly documented. Simply choosing to move abroad voluntarily is not sufficient: a documented company contract or relocation is required. The burden of proof lies with the taxpayer, and the Tax Agency may request specific documentation in a verification procedure.
Implicaciones prácticas: declaraciones pasadas y futuras
Practical implications: past and future tax returns
La resolución TEAC de enero de 2026 tiene carácter vinculante para la Administración tributaria española. Esto significa que los contribuyentes que en ejercicios anteriores fueron penalizados por Hacienda al no reconocerles la exención por reinversión en estos supuestos, disponen de la posibilidad de rectificar su situación.
The January 2026 TEAC ruling is binding on the Spanish tax administration. This means that taxpayers who in previous tax years were penalised by the Tax Agency for not being granted the reinvestment exemption in these situations have the possibility of correcting their position.
Las vías disponibles dependen de si la liquidación ya es firme o no, y del tiempo transcurrido desde que se produjo el perjuicio. En LexStart analizamos cada situación individualmente para determinar si procede:
The available routes depend on whether the assessment is already final and how much time has passed since the damage occurred. At LexStart we analyse each situation individually to determine whether the following are appropriate:
- Solicitud de rectificación de autoliquidación (si el contribuyente presentó la declaración sin aplicar la exención).
- Application to rectify a self-assessment (if the taxpayer filed the return without applying the exemption).
- Recurso de reposición o reclamación económico-administrativa (si existe liquidación provisional o definitiva de la AEAT).
- Appeal or economic-administrative claim (if there is a provisional or final assessment from the Tax Agency).
- Recurso contencioso-administrativo ante la Audiencia Nacional (para liquidaciones firmes en vía administrativa).
- Administrative appeal before the National Court (for assessments that are final in administrative proceedings).
El plazo general de prescripción en materia tributaria es de cuatro años desde el último día del plazo de presentación de la declaración del ejercicio en cuestión. Si Hacienda giró una liquidación indebida hace más de cuatro años, la situación puede ser irrecuperable salvo que existan circunstancias que hayan interrumpido la prescripción. Conviene revisar la situación cuanto antes con un asesor especializado.
The general limitation period in tax matters is four years from the last day for filing the return for the relevant year. If the Tax Agency issued an improper assessment more than four years ago, the situation may be unrecoverable unless there are circumstances that interrupted the limitation period. It is advisable to review the situation as soon as possible with a specialist adviser.
¿Qué debes hacer si estás en esta situación?
What should you do if you are in this situation?
Si has vendido tu vivienda habitual en España por un traslado laboral al extranjero y Hacienda no te reconoció la exención, o si estás pensando en vender y quieres asegurarte de aplicarla correctamente, el primer paso es un análisis de la situación concreta que incluya:
If you have sold your main residence in Spain due to a job relocation abroad and the Tax Agency did not recognise the exemption, or if you are thinking of selling and want to ensure you apply it correctly, the first step is an analysis of the specific situation including:
- Verificar que el traslado tiene naturaleza laboral y está documentado (contrato de desplazamiento, carta de asignación internacional, etc.).
- Verifying that the relocation is work-related and documented (secondment contract, international assignment letter, etc.).
- Determinar el país de destino y si puede invocar la Disposición Adicional Séptima de la LIRNR (residentes en UE/EEE).
- Determining the destination country and whether the Seventh Additional Provision of the LIRNR can be invoked (EU/EEA residents).
- Calcular la ganancia patrimonial y el importe potencial de la exención para valorar el impacto económico real.
- Calculating the capital gain and the potential amount of the exemption to assess the real economic impact.
- Revisar si hay liquidaciones pendientes o si todavía se está dentro del plazo de prescripción para rectificar.
- Checking whether there are pending assessments or whether the limitation period for rectification has not yet expired.
En LexStart asesoramos tanto a expatriados que necesitan aplicar la exención por primera vez como a quienes buscan reclamar lo que Hacienda les denegó indebidamente en ejercicios anteriores.
At LexStart we advise both expatriates who need to apply the exemption for the first time and those seeking to recover what the Tax Agency wrongly denied them in previous years.