Purchase and sale of the main home in Spain. Tax benefit in the Capital Gain Tax.

Capital Gain Tax. Exemption for the main home.

Concept: Capital Gain on the sale of real estate.

When we sell a property in Spain we have to pay a tax on the profit we obtain. It is the Capital Gains Tax, CGT. This goes from 19% to 23%. But, it is possible not to pay anything, when it comes to the main home or habitual residence.

Capital Gain. Calculation

In general, we can say that the Gain is the difference between:

– Transmission Value. The price for which we are selling the property. Less, if applicable, real estate agency fees, etc.

– Acquisition value. The price paid. Plus: taxes, notary fees, property registration, etc.

The profit is taxed on:

– 19% on the first €6,000.

– 21% from €6,000 to €50,000.

– 23% from €50,000.

Tax benefit. Exemption for reinvestment in the main home

In Spain, it is foreseen as an exemption. No capital gain will be paid on the sale of the habitual residence or main home. Provided that profit is reinvested in the acquisition or rehabilitation of a new habitual residence.

Reinvestment that must be carried out within two years.

Concept of habitual residence or main home

Legally, the main home is considered the one that constitutes the habitual residence for at least three years.

Example Reinvestment in habitual residence. Capital Gain Tax Exemption

A total exemption is possible. That is, when all the money received is reinvested.

For example. We sell our home for the price of €100,000, and we make a profit of €30,000. If we reinvest the €100,000 in a new habitual residence. We will NOT pay any tax, for the profit of €30,000.

Also, it can be a partial exemption. When all the money is not reinvested. In the above case. Let’s imagine that from the €100,000 of the sale, only €50,000 is reinvested in a new habitual residence. That is, 50%. In this case, we would not pay tax on 50% of the capital gain, that is, €15,000.

The existence of a mortgage loan. How it affects the reinvestment in the habitual residence

The Spanish tax authority understood that if a loan was obtained to buy the new habitual home, it was only understood as reinvested, the capital repaid within the first two years, of the loan.

In a recent ruling, the Supreme Court, of October 2020, has changed the criteria.

Now pay attention to the economic value of the reinvestment, that is, the value of the property.

Thus, if instead of reinvesting the money obtained, we save it, but we buy a property, with a mortgage loan, we will be able to benefit from the exemption even if we do not reinvest the money. If the asset has the same or greater value.

So, following the previous example. If we sell for €100,000. We keep the money. And we bought another habitual home for €100,000 that we fully financed, with a mortgage loan. The exemption would apply to the entire profit. Although we have not invested the money from the sale.


 If you want to sell or buy a property in Spain; being your main home or not; if you need advice on Capital Gains Tax. Contact us.

The information provided in this article is not intended to be legal advice, it merely conveys information related to legal issues.


Carlos Baos (Lawyer)

White & Baos.

Tel: +34 966 426 185

E-mail: info@white-baos.com

White & Baos 2021 – All Rights Reserved.

16 thoughts on “Purchase and sale of the main home in Spain. Tax benefit in the Capital Gain Tax.

  1. Good afternoon,
    I’m being investigated by the tax at the moment for the year 2017, reason being. I had a house built [main residence] in 2001 at a total cost of €503,824, I sold it in 2017 for €780,000 giving me a profit of €276,176, for some reason I paid €15,549 CGT. I purchased another property [again a main residence] a month or so later for €330,000, tax paid in the notaria office €28,200, necessary reform work spent €41,365 [I have ALL receipts of everything] I just missed the 65 year old cut off [I was 65 in November 2017] In my opinion I should not have paid ANY CGT, please could you advise me? Many thanks Ray

    1. Thank you for your message.
      If you reinvested partially the profit in another main home property, then you have a right to deduct part of the CGT to be paid, but only in the proportional part reinvested.

      If you want you could contact us at info@white-baos.com and the telephone 0034 966 426 185

      Best regards,

  2. Good Morning.
    We sold our US main home this year and immediately bought our permanent new home in Spain as Tax Residents.
    The amount reinvested was only a portion of the capital gain.
    Our question is:
    Will we be liable for 100% of the US Capital Gains, or would the invested portion be deducted.
    Thank you very Much

    1. Thank you for your message. Each case must be studied in detail. Also, it coudl be relevant your age, if the property sold and bought coudl be considered your main home and also it is relevant your tax resiency. If you want, you could contact us in our email info@white-baos.com or at the telephone 0034 966 426 185, and book an appoitment to speak with one of your expert lawyers.

  3. I noticed you stated for “legal purposes” a house needs to be lived in for 3 years to be considered your main home (regarding the main home exemption in Spain for capital gains).

    The question is, how do you PROVE the house was your main home? What documents are required?

    1. Thank you for your message. Normally with the Padron of the Town Hall, also must appear in your income tax declaration as your main home, etc.
      If you want, you could contact us in our email info@white-baos.com or at the telephone 0034 966 426 185, and book an appoitment to speak with one of your expert lawyers.

  4. Sold my main residence in spain 2018 then immediately rented it now still renting it could that be classed as reinvestment paying 600 a month

  5. Hello I want to know if the two years exempt rule applies only for EU houses only. For exemple, if I sold my primary house in Canada (while I was tax resident in Spain) and within two years I purchases the primary house in Spain. Will that exemption rule be applied if the sold house was in non-EU country (like Canada)?

    1. Thank you for your message.

      Yes, it is possible, but I must be studied the case in detail and see if it matches with the requisites foreseen in the law.

      1. Hello Carlos.

        Is it possible that we proceed in detail in my case? This is very impotant to know as I need what to do as next steps.

  6. Hi Carlos. I am EU resident and non TAX resident in Spain. I recently sold my 12 bedroom hostal and made a profit on the property of about 135.000€. But I made a loss of 90.000€ on the business in this hostal. Can I offset the loss against the profit so I have to pay only 19% of 135.000-90.000=45.000×19%=8.550€ CGT ? Further I am going to live in another apartment as habitual resident where I did a renovation of 20.000€ less than 2 years ago. How much I need to pay overall as CGT? Thanks Peter

  7. I am now s tax resident in Spain since I live there . I have a house in the UK.it my only property since I rent in Spain.. I lived in my UK property for 15 years before renting or Out in the last 4.years. if I sell my house and reinvest all of the money in Spain , am I still liable for CGT? THANKS

  8. we bought a house in spain 8 years ago and have just become residents , we only have this one house, we paid 80 thousand euros and want to sell it for 220 thousand, we want to buy a bigger house at 105 thousand plus taxes and charges and will have to spend 60 thousand renovating, we have only just become residents , will we have to pay capital gains tax or not ? once we deduct our initial investment plus purchase price , tax and charges , plus renovating amount there is no gain left?

    1. Thank you for your message.

      It must be checked if the property could be considered in Spain as your main home, to be able to apply for the main home tax reduction, and if applies to you the possibility of do not pay CGT if you reinvest and/or renovate a new main home.

      You could book an appointment with our lawyer at info@white-baos.com

Leave a Reply

Your email address will not be published. Required fields are marked *