Frequently asked questions

What happens if I sell my main residence before 3 years?

It depends on your tax situation. Selling your main residence before completing the timeframes required by law to maintain certain benefits (reinvestment, exemptions or special treatment) may mean you have to pay personal income tax (IRPF) on the capital gain or lose advantages enjoyed in previous years. There is no single answer without specific dates of purchase, sale and actual use as a home.

Main residence for IRPF purposes: why it is not just about "living there for 3 years"

In everyday language, people talk about "three years" when selling the flat where they live. For tax purposes, what matters is whether the property satisfies the legal definition of main residence under Royal Legislative Decree 3/2004 (LIRPF) and its implementing regulations, and whether you apply mechanisms such as the reinvestment relief under Article 41 bis or exemptions linked to age and specific conditions.

The required period of residency is not simply a matter of counting months on the calendar without checking municipal registration (empadronamiento), family life, centre of financial or personal interests, or alternative homes. Checking your circumstances with a tax advisor before putting up the listing will prevent poor net price planning.

Tax regime according to length of residency and cause of transfer

Differences in IRPF treatment when transferring the property before completing three years of continuous residency.

  • Legal criteria

    Main residence status

    Sale before 3 years with justified grounds

    Retains main residence status

    Sale before 3 years without justified grounds

    Does not qualify for main residence status

  • Legal criteria

    Access to reinvestment exemption (Art. 38 IRPF Act)

    Sale before 3 years with justified grounds

    Possible if reinvestment requirements are met

    Sale before 3 years without justified grounds

    Not applicable

  • Legal criteria

    Tax treatment of capital gain

    Sale before 3 years with justified grounds

    Exempt if the proceeds are reinvested in accordance with regulations

    Sale before 3 years without justified grounds

    Taxable under the savings tax base

Regulated by Royal Decree 439/2007 of 30 March (IRPF Regulations).

Fuente: BOE: Real Decreto 439/2007, art. 54

Reinvestment in another main residence

If you sell a main residence and reinvest the proceeds into another property that will also serve as your main residence, regulations provide favourable tax treatment provided requirements regarding amount, timeframe and proof are met. Selling "too soon" can interfere with this if you have not yet established main residence status for the property you are selling, or if the reinvestment does not meet legal thresholds.

Article 41 bis and its enabling rules regulate timeframes for purchasing the new home and conditions regarding the reinvested portion. It is not automatic: tax declarations and supporting documents are required.

If you sell without reinvesting

When you do not reinvest in another main residence within the set timeframes, the capital gain from the sale is generally included in the savings tax base for IRPF in the tax year of the transfer, unless other exemptions apply (such as for those over 65 in regulated circumstances, capital losses, etc.). This is separate from municipal capital gains tax on land value.

Consult our guide IRPF on the sale of a property to clarify key concepts. If you also wonder whether you must include the transaction in your tax return, review declaring the sale of a flat on your tax return.

Recent change of address

Moving to another home and selling the previous one shortly afterwards raises the question of whether the property you are selling is still considered your main residence in the tax year of the sale. That distinction changes which exemptions apply. Do not copy the tax strategy of a neighbour who has a different purchasing timeline.

Second home sold "quickly"

If the property was not your main residence, the sale is taxed under general capital gains rules without the benefit of main residence reinvestment relief. A common mistake is assuming that "since it was my only flat", it is automatically a main residence even if you have lived elsewhere for months.

Planning before listing the flat

  • Request a tax simulation using acquisition dates, amounts and deductible improvements.
  • Consider whether it is better to delay the sale or bring forward the purchase of the new main residence.
  • Factor municipal capital gains tax, apportioned IBI and fees into the same spreadsheet.
  • Keep invoices for home improvements and expenses that tax regulations allow you to add to the acquisition value.

Sale and tax return

The sale is reported in your IRPF return for the year the title deed is executed, unless your tax advisor indicates special mechanisms. If you sell in December and buy in January, reinvestment deadlines can be critical: do not leave planning until after signing.

Renting after the sale

If you sell with a guaranteed rental scheme or stay on as a tenant, the transaction remains a transfer of ownership with its own tax implications. Do not confuse main residence exemptions with the subsequent tenancy agreement. Seek specific guidance if you choose a sale with guaranteed rent.

Prior gifts or usufruct

If you received the property as a gift or transfer it while retaining usufruct, the calculation of gains and exemptions changes. Each prior title deed alters the acquisition value and timeframes. Provide the complete ownership chain to your tax advisor.

Next step

Before setting a minimum price, understand the tax impact of selling within your specific timeline. At Sky Real Estate, we manage the commercial process; your tax return and reinvestment strategy should be validated by your tax advisor.

Property sales and development service.

This content is for guidance only and does not constitute tax advice. Verify details with the AEAT and the LIRPF in force for your tax year.

Frequently asked questions

What is considered a main residence for IRPF purposes?
For IRPF purposes, a main residence is defined as a dwelling that constitutes the taxpayer's residence for a continuous period of at least three years. It also retains this status if circumstances arise that necessitate a change of address, such as marriage, marital separation, job relocation, obtaining a first job or changing employment, among other reasons specified in the regulation.

Fuente: BOE, Real Decreto 439/2007, de 30 de marzo, art. 54.1

What happens if a property is sold before completing 3 years of residency without justified grounds?
If the property is transferred before reaching three continuous years of residency without a legally recognised exception, the dwelling does not acquire main residence status and the capital gain cannot benefit from reinvestment relief.

Fuente: BOE, Real Decreto 439/2007, de 30 de marzo, art. 54.1

Within what timeframe must the property be occupied after purchase for main residence periods to count?
The property must be effectively and permanently occupied by the taxpayer within twelve months from the date of acquisition or completion of construction work.

Fuente: BOE, Real Decreto 439/2007, de 30 de marzo, art. 54.2

What is the legal timeframe to reinvest the capital gain in another main residence?
The reinvestment of the proceeds obtained from the transfer must take place, in a single payment or in instalments, within a period not exceeding two years from the date of transfer of the main residence.

Fuente: BOE, Real Decreto 439/2007, de 30 de marzo, art. 41.1