Can you lose the primary residence reinvestment exemption if you move out before 3 years?

In this guide we explain how the Primary residence reinvestment exemption for job relocation in Spain works under Spanish Personal Income Tax (IRPF), what evidence is worth keeping, and how to avoid tax reassessments.

Selling your primary residence and buying another can bring an important tax benefit in Spain: the primary residence reinvestment exemption (a capital gains tax exemption under IRPF). But there is a very common (and very real) question: what happens if, after buying the new home, you have to move out before the 3-year period?

Spain’s General Directorate of Taxes (Dirección General de Tributos, DGT) has analysed a typical scenario: sale of a primary residence, reinvestment in a new primary residence…and later, a job relocation that forces a change of city. Its approach is especially useful for taxpayers living or investing in Málaga, Nerja, Andalusia or elsewhere in Spain who plan a change of address for professional reasons.

In particular, it provides a solid framework to understand how the primary residence reinvestment exemption works where a job relocation makes a change of address unavoidable.

This post is specifically about Primary residence reinvestment exemption for job relocation in Spain and how to keep the relief when the move is unavoidable.

Primary residence reinvestment exemption for job relocation: the core idea

If you sell your primary residence and reinvest the amount obtained into buying another primary residence, the capital gain on the sale can be exempt (fully or partially) in your IRPF.

Primary residence reinvestment exemption for job relocation in Spain is most relevant when you reinvest in a new home and later face an employer-mandated relocation.

Requirements (in plain English)

  • The home you sell must qualify as your primary residence.
  • The home you buy must also become your new primary residence.
  • The reinvestment must be made within the statutory time limits (generally, within the period set out in the regulations).

In practice, this is very common: you sell in Málaga and buy in Nerja (or the other way around), or you move city for work (Barcelona, Madrid, etc.). Teleworking and short-term rental plans can also be part of the background in real-life cases.

Job relocation and the 3-year rule

For a property to be treated as a “primary residence”, the general rule requires it to be your habitual residence for at least 3 years.

Does that mean you can never move out before 3 years?

Not exactly. The rules include exceptions, but there is a key condition: there must be a circumstance that necessarily requires the change of address.

For Primary residence reinvestment exemption for job relocation in Spain, the key test is whether the job relocation necessarily required changing your habitual residence.

Exemption for reinvestment in primary residence for job relocation: real case study

This is the classic example of the primary residence reinvestment exemption and job relocation: you reinvest and, later, your employer requires you to move to a different work location.

In the DGT ruling analysed (V1085/2025), the taxpayer:

  • Sold her primary residence.
  • Reinvested in another property (intended to be her new primary residence).
  • Later, her employer informed her that, to maintain her employment conditions, she had to relocate to another office/site.

The question was straightforward: does she lose the reinvestment exemption because she does not reach 3 years of residence in the new home?

This is precisely where Primary residence reinvestment exemption for job relocation in Spain matters: if the relocation forces a move, leaving before 3 years should not automatically disqualify the home as your primary residence.

Relocation that is truly necessary: DGT’s approach

The Spanish Directorate-General for Taxation stresses that a job relocation in the abstract is not enough. The decisive point is whether the relocation necessarily requires a change of address.

How “necessarily” is interpreted in the exemption for reinvestment in the primary residence for job relocation?

In simple terms:

  • If moving is optional (because you can stay where you are without losing your job or suffering a real, material detriment), it is harder to fit within the exception.
  • If moving is effectively mandatory (because without moving you would lose essential conditions or the position itself), there are grounds to argue that the property does not lose its status as a primary residence.

The Spanish Directorate-General for Taxation (DGT) also points out that this is not automatic: the facts must be analysed case by case.

Who decides whether the relocation truly ‘forces’ the move? (exemption for reinvestment in habitual residence for job transfer)

This is an important practical point. The DGT explains that, because this is a factual issue, it cannot certify the necessity in the abstract. In practice:

  • The assessment is made by the tax authorities’ management/audit bodies.
  • The taxpayer must provide sufficient evidence that the change of address was necessary.

Evidence checklist to protect the exemption for reinvestment in the primary residence for job relocation

If you move out before 3 years and want to keep the exemption for reinvestment, it is advisable to gather:

For Primary residence reinvestment exemption for job relocation in Spain, documentary evidence and a consistent timeline are usually decisive.

  • Written communication from the employer (email, letter, HR) describing the relocation and its scope.
  • Proof that the relocation was not voluntary: conditions, requirements, dates and reasons.
  • Documentation of the new situation: contract addendum/novation, work site, on-site attendance schedule.
  • Evidence of effective change of address: municipal registration, utility contracts, school enrolment for children (if applicable), travel tickets, rental or purchase at destination.
  • A clear timeline: when the home was acquired, when it was occupied, when the relocation was notified and when the move actually took place.

Tip: the more linear the timeline (purchase → effective residence → unforeseen relocation), the more robust the position tends to be.

If the Tax Agency accepts the relocation: keeping the exemption for reinvestment in the primary residence for job relocation

If you can demonstrate that the job relocation necessarily required changing your address, leaving the property before 3 years should not remove its status as a primary residence. As a result, the reinvestment exemption previously applied should be maintained.

If the Tax Agency rejects the relocation: loss of the exemption for reinvestment in the primary residence for job relocation

If the tax authorities conclude that the move was not necessary, the consequence is clear: the requirement is not met, and the capital gain that was treated as exempt may become taxable.

What would you need to do?

  • File a supplementary (amended) IRPF return for the year in which the capital gain was originally reported as exempt.
  • Add late-payment interest (interest on arrears).
  • Observe the relevant deadlines for regularisation, which depend on when the breach occurs.

Impatriates and the Beckham Law: primary residence, reinvestment and common mistakes

If you are internationally mobile and have opted (or are considering opting) for the special tax regime for inbound workers (the “Beckham Law”), pay close attention to how Spanish real estate is treated. In practice, many impatriates who settle in Málaga, Nerja or elsewhere in Andalusia buy their first home “to live in” and years later consider changing it (for a job relocation, family reasons, or simply to improve location). That is where unpleasant surprises can arise.

Person holding a French passport, illustrative image about expatriates and the Beckham Law in Spain, for exemption due to reinvestment in primary residence due to job transfer.

Beckham Law and impatriates: do not automatically extrapolate the benefits of ‘habitual residence’ from general income tax.

As a professional firm of lawyers and economists specialising in Spanish tax law, we advise on the Beckham Law in Málaga and Nerja, as well as across Andalusia and the rest of Spain.

1) What changes under the Beckham Law (simple explanation)

Under the Beckham Law you file a special personal income tax return, but much of the computation follows rules similar to Spanish Non-Resident Income Tax (IRNR), with specific features.

For real estate, the key idea is:

  • If the income or capital gain is considered sourced in Spain (for example, because the property is located in Spain), it is generally taxable in Spain within the special regime.
  • However, the “classic” IRPF benefits linked to a primary residence do not automatically apply in the same way (and this is the critical point for the reinvestment exemption).

2) Beckham Law: does the primary residence reinvestment exemption for job relocation apply?

This point must be made very clearly to avoid false expectations:

  • The traditional administrative position has been that the primary residence reinvestment exemption (an IRPF concept) is not available to taxpayers taxed under the impatriate special regime.
  • The practical rationale is that the special regime borrows key mechanics from IRNR, where the primary-residence framework that triggers these reliefs is not the same.

In practice, Primary residence reinvestment exemption for job relocation in Spain should not be assumed under the Beckham Law; it must be analysed case by case before you apply it on the return.

Practical translation: if you sell a property in Spain while under the Beckham Law and realise a capital gain, do not assume that reinvesting in another home will automatically make that gain exempt as it would under the general IRPF regime.

Note: there is doctrinal debate and litigation on other housing-related points under the special regime (e.g., imputed income). For reinvestment, a conservative planning baseline is recommended: do not rely on the exemption without a detailed review of your facts and of the tax year in which you fall under the regime.

3) Typical scenarios we see in practice

Case A — You sell your home abroad and buy in Spain (Málaga/Nerja)

Imagine you move to Spain for work, opt for the Beckham Law and, once settled, sell your home abroad (for example, in the US or the UK) to buy a home in Spain.

  • In many cases, that foreign gain will not be “Spain-sourced income” and therefore will not be taxable in Spain under the special regime.
  • If it is not taxed in Spain, you do not need a Spanish reinvestment exemption to protect it.

Caution: this depends on dates, effective tax residence, applicable tax treaties and whether the transaction is treated as connected to Spain. Residence conflicts and treaty issues are common here, so it is worth reviewing before acting.

Case B — You sell a home in Spain and buy another (the typical ‘upgrade’)

This is where most mistakes happen:

  • An impatriate in Spain (Beckham Law), with a home in Málaga city.
  • They sell that home and buy another (for example, in Nerja or another part of Andalusia), assuming: “I reinvest → the gain is exempt”.

Risk: under the Beckham Law, a gain on Spanish real estate is usually reportable in Spain, and the reinvestment exemption is not automatically available.

Result: you may face a tax reassessment if you apply the exemption “as if” you were under the general IRPF regime.

Case C — You change homes before 3 years for job relocation

Under the general IRPF regime, the debate is typically whether the relocation necessarily requires the change of address to preserve primary-residence status.

Under the Beckham Law, there is an additional prior question:

  • do you have access to the reinvestment relief at all?

If the restrictive position applies, the evidence work on the 3-year exception may not help, because the issue would not be primary-residence status but the applicability of the relief under the special regime.

Case D — Timing and planning: should I be under Beckham in the year of sale?

Sometimes the decision is not just ‘Beckham yes or no’, but ‘when’.

If you expect to sell Spanish real estate with a high capital gain and your priority is to attempt the reinvestment exemption, it can be worth comparing scenarios:

  • Remain under the Beckham Law in the year of sale.
  • Exit the special regime (if possible and appropriate) and be taxed under the general IRPF regime, accepting the impact on other income.

This comparison requires numbers and a review of deadlines, because renouncing/exiting the regime cannot be improvised at the last minute.

4) Mini-checklist (Beckham Law / impatriates) before you sell or reinvest

Before relying on the reinvestment exemption (or before signing a reservation/arras), review:

  • Are you formally under the Beckham Law (and since which tax year)?
  • Is the property you are selling in Spain or abroad?
  • Is the gain considered Spain-sourced income?
  • Is your objective “pay less on the gain” or “pay less overall” (salary, bonus, stock options, etc.)?
  • Are you changing homes for job relocation or another objective cause?
  • Does it make sense (and is it feasible) to plan the sale outside the special regime period?
  • If you hold assets abroad, review information reporting obligations (Modelo 720/721, where applicable).
Road sign ‘Expatriate Next Exit’, associated with work relocation and impatriates (Beckham Law) in Spain, due to exemption for reinvestment in primary residence due to work relocation.

International mobility and job relocation: tax considerations before moving (reinvestment and the Beckham Law).

5) Useful note: primary residence and ‘imputed income’ under the Beckham Law

A common mistake is to think that, if the property is your primary residence, there is never any imputed income. Under the general IRPF regime this has nuances, but under the Beckham Law there has been controversy and relevant administrative criteria.

As a rule of thumb: if you are under the special regime, avoid automatically extrapolating general IRPF primary-residence rules. For housing (capital gains, imputed income and reliefs), the Beckham Law has ‘blind spots’ that should be reviewed before you act.

Practical conclusion (impatriates): If you are an impatriate or are considering becoming one (for example, because you are coming to work in Málaga, Nerja, Andalusia or elsewhere in Spain), your case should be analysed before assuming you can apply the reinvestment exemption in the same way as a taxpayer under the general regime.

Frequently asked questions (FAQ)

Does the reinvestment exemption work the same in Málaga, Nerja and the rest of Andalusia?

Yes. This exemption is a state-level IRPF relief and does not vary by autonomous community. What can vary territorially are other real-estate taxes (ITP/AJD), but not the reinvestment exemption itself.

Is it enough to say “I was relocated for work”?

No. You must be able to demonstrate that the relocation necessarily required a change of address.

What if the relocation is partial (teleworking, only a few on-site days)?

It depends. In these scenarios, the tax authorities tend to examine whether it was truly necessary to leave the home and move your centre of life.

What happens if I buy to reinvest and later rent out that property?

This can be problematic if it stops being your primary residence. Dates, effective occupation and the reasons for the change should be reviewed.

More articles on the primary residence reinvestment exemption…

Conclusion: the exemption can be kept, but you must ‘lock in’ the evidence

If you have reinvested in a primary residence and you are forced to move out before 3 years for a job relocation, the primary residence reinvestment exemption for job relocation can be maintained, provided that the change of address was necessary and you can prove it.

If you are in a mobility context — especially if you apply (or plan to apply) the Beckham Law or are an impatriate — planning is even more important.

Need your case reviewed?

At Pérez Parras Economists & Lawyers we analyse reinvestment scenarios, job mobility, tax residence changes and planning for residents and non-residents, with a particular focus on Málaga, Nerja, Andalusia and cross-border transactions.

If you wish, we can:

  • Assess whether your relocation fits within the exception.
  • Design the evidence strategy.
  • Evaluate reassessment risk and alternatives.
  • Review your IRPF position.

Contact Pérez Parras Economists & Lawyers so we can resolve your case on a tailored basis.