Selling Your US Home After Moving to Spain: Section 121 and IRPF

By Aurelio Maurici

Co-founder, legal, tax and cross-border financeMaster of Business Law, Aix-Marseille Université

Published Updated Last verified

Moving from the UK? Read our guide to selling or renting your UK home after moving to Spain.

A calculator, a set of keys and a small house model on a table

Selling your U.S. home after moving to Spain is partly a U.S. tax question: whether the Section 121 exclusion still covers the gain, and whether the 3.8 percent surtax reaches the rest. The other part is Spanish, since a Spanish tax resident is taxed on worldwide gains, the house included, while the treaty preserves the U.S. claim and Spain credits the U.S. tax. Three dates settle the bill: the day you moved out, the day you pass 183 days in Spain, and the closing. This article is for informational purposes only and is not immigration, tax or medical advice; verify current requirements with the relevant Spanish authority or a licensed professional.

Does Spain get to tax a house that sits in the United States?

It does, for every calendar year in which you are resident. The Agencia Tributaria treats you as a Spanish tax resident for any calendar year in which you spend more than 183 days in Spain or have the core of your economic activities or interests there, and a resident is taxed on gains wherever the asset is located, under the Ley del IRPF. There is no partial year, so exceeding 183 days in the year of arrival makes you resident for the whole of it, a sale in February included.

The U.S.-Spain income tax convention keeps the United States in the picture. Under its capital gains article, gains from the alienation of real property situated in the other contracting state may be taxed in that other state, so that a house in Texas remains taxable in the United States whatever your residence; the treaty’s saving clause, for good measure, lets the United States tax its citizens as if the treaty did not exist, except for the double-taxation relief of Article 24. Relief therefore falls to Spain as the country of residence, and the Agencia Tributaria’s deduction for international double taxation allows the lesser of the tax actually paid abroad on the gain and the Spanish tax that corresponds to it.

The consequence is easy to state and easier to miss. If the exclusion absorbs the gain, so that no U.S. tax is due, there is no U.S. tax to credit either, and the Spanish tax on that same gain is paid in full unless a Spanish exemption applies. A sale completed in a calendar year in which you are not a Spanish tax resident never opens the Spanish side at all.

The two clocks, side by side

The U.S. clock starts on the day you stop living in the home, since the use test looks back over the five years before the sale; the Spanish clock starts with the calendar year in which you pass 183 days. The table runs down from the sale date.

When the sale closes IRS Spain
Before the move, in a calendar year in which you will not be a Spanish resident Exclusion of up to $250,000, or $500,000 on a joint return, if you owned and used it 2 of the last 5 years Nothing: Spain has no claim in a year in which you are not resident (the year of arrival is the next row)
In the calendar year of arrival, staying more than 183 days Same exclusion, same tests Resident for the whole year: the gain is taxable, with a deduction for U.S. tax paid; the reinvestment exemption can apply if the home was your habitual residence within the 2 years before the sale and the proceeds buy a habitual residence within 2 years
Within 2 years of moving out, in a later year Same exclusion, same tests Same as above: the 2-year window for a former habitual residence is still open
Between 2 and 3 years after moving out Exclusion still available while 24 months of use fall inside the last 5 years No reinvestment exemption and, in general, no over-65 exemption: the home is no longer a habitual residence, so the full gain is taxed at 19 to 30 percent, less the U.S. tax credited
More than 3 years after moving out Exclusion generally lost; the gain is taxed and the 3.8 percent surtax can apply above the income thresholds Full gain taxed, less the U.S. tax credited

The Section 121 exclusion and its 5-year window

Under the rule the IRS describes, you may exclude up to $250,000 of gain from the sale of your main home, or up to $500,000 if you file a joint return with your spouse, provided that you meet both an ownership test and a use test. The ownership test is met if you or your spouse owned the home for at least 24 months of the 5 years ending on the date of the sale; the use test, if you lived in it as your residence for at least 24 months of those same 5 years. The two 24-month periods need not coincide, but both must sit inside the 5 years before the sale.

That is the clock. Someone who moves to Spain on May 5, 2026, having lived in the home for years, continues to meet the use test for as long as 24 months of residence remain inside the 5 years before the sale, which is roughly until May 2029. After that the exclusion is generally gone; Topic 701 refers to Publication 523 both for the exceptions to the two-year rule and for the situations that suspend the 5-year period.

On a joint return, either spouse may meet the ownership test, but both must meet the use test individually, as Publication 523 sets out, and the IRS states that you are generally not eligible if you excluded the gain from another home during the two years before the sale. Reporting follows the paperwork rather than the tax: if you receive Form 1099-S, Proceeds From Real Estate Transactions, the sale must be reported even if all the gain is excludable, and it must be reported in any event if part of the gain cannot be excluded, on Schedule D and Form 8949. A zero tax bill, in other words, is not a blank form.

The 3.8 percent surtax and what the exclusion shields

Whatever gain exceeds the exclusion is investment income. The IRS applies a 3.8 percent net investment income tax to the lesser of your net investment income and the amount by which your modified adjusted gross income exceeds $200,000 for a single filer or head of household, $250,000 for a couple filing jointly or a qualifying widow(er) with a child, and $125,000 for a married person filing separately. Because net investment income, in the IRS’s words, does not include gain on the sale of a personal residence that is excluded from gross income, the exclusion shields what it covers and nothing beyond it. The tax is computed on Form 8960.

For a seller living in Spain, two points move the result. The part of the gain that the exclusion does not cover is added to income in the year of sale, and it is often that addition which carries a household past the threshold. The Form 8960 instructions say that amounts excluded under the foreign earned income exclusion are generally added back when computing modified adjusted gross income, so a Spanish salary excluded on Form 2555 does not keep you under the line.

The Spanish side: savings base, exemptions, and the credit

A resident’s gain on real estate is taxed in the savings base of the IRPF. For 2025, the state scale and the regional scale published by the Agencia Tributaria each run from 9.5 percent to 15 percent across five brackets, and the two apply together: 19 percent on the first 6,000 euros, 21 percent up to 50,000 euros, 23 percent up to 200,000 euros, 27 percent up to 300,000 euros and 30 percent beyond. A $400,000 gain on a house is therefore not taxed at 30 percent; it climbs through the brackets, and the credit for the U.S. tax comes off the result.

For a U.S. home bought and sold in dollars, the Dirección General de Tributos, in binding ruling V1615-25 of 2025, computes the gain in dollars and converts the difference into euros at the exchange rate on the day of the sale. Converting the dollars into euros later is a separate currency gain or loss, taxed only when the exchange takes place, as ruling V0152-26 holds for U.S. shares; the currency, in effect, leads a tax life of its own. The remainder of the Spanish return is set out in the guide to your first Spanish income tax return.

The reinvestment exemption

The Agencia Tributaria exempts the gain on the sale of your habitual residence to the extent that the full amount obtained is reinvested in buying another habitual residence, or in qualifying rehabilitation of the one that will become it. Under Article 41 of the IRPF Regulations, if you bought the home sold with a loan, the amount obtained is the sale price less the loan principal still unpaid at the sale. Four conditions carry the weight. The exemption is not automatic, since the return must state that it is being claimed; both the home sold and the home bought must qualify as habitual residences; the reinvestment must happen within two years, counted date to date, a period that may run before the sale as well as after it; and if less than the full amount obtained is reinvested, only the proportional part of the gain is exempt.

The meaning of habitual is set out in the same terms for the over-65 exemption: a building in which you live for a continuous period of at least three years, counted from the date you acquired it (or the works were completed) if you moved in within twelve months of that date. A shorter period still qualifies if circumstances that necessarily require a change of address intervene first, and the Agencia Tributaria’s own examples include a job transfer, a first job or a change of job, marriage and separation. A home also counts as your habitual residence for these exemptions if it was so at the moment of sale or on any day within the two years before it.

For an American who lived in the U.S. home for three years or more before leaving it for Spain, all of this amounts to a two-year window: a sale within two years of moving out, a new habitual residence bought within two years of the sale (or in the two years before it), and a claimed exemption remove the Spanish tax on the gain to the extent that the proceeds go into the new home. Outside the window, the Spanish gain is taxed in full, with only the U.S. tax, if any, as a credit. The wire that carries the proceeds to Spain has costs of its own, which moving money from the U.S. to Spain sets out.

Over 65: the exemption without reinvestment

According to the Agencia Tributaria, gains from the transfer of the habitual residence by a person over 65 are exempt with no reinvestment required. The home counts as habitual if it was so at the time of the sale or on any day within the two years before it. Since Real Decreto-ley 26/2026 took effect on October 1, 2026, amending Article 41 bis of the IRPF Regulations, a seller over 65, or in severe dependency, also keeps that status until moving to a specialized center or to a relative’s home, up to the third degree, because of age or dependency; the Agencia Tributaria’s page does not yet reflect this, and a decree-law remains subject to validation by Congress. Where ownership is split between a bare owner and a usufructuary, neither can use the exemption. For a retiree who sells the family home within two years of the move, this is the Spanish side of the calculation, and it turns the sale date into a matter of months.

The state layer

A state may tax the sale as well. In its residency guidelines, the California Franchise Tax Board states that gain from the sale of real estate is sourced where the property is located, so that a California property sold after you move out of state produces California-source income even though you are by then a nonresident. Other states apply their own sourcing rules, and none of them is bound by the U.S.-Spain treaty. The state side of a move is covered in breaking state tax residency before you leave.

A home you rented out after the move

Renting the house out while you decide alters both halves of the analysis. On the U.S. side, Publication 523 covers rental and business use: you cannot exclude the part of the gain equal to depreciation allowed or allowable after May 6, 1997, and that is not the arithmetic of a plain sale. On the Spanish side, a resident reports the rent as income during the rental years, and the home ceases to be a habitual residence from the day you leave it, so the two-year window described above keeps running whether or not a tenant is in place. Both halves are worth pricing before a lease is signed, since the tenant’s term and the two-year window rarely end on the same day.

Put the three dates on one line before you list the house

The three dates that matter are the day you moved out, the day you will pass 183 days in Spain, and the earliest day on which a sale could close. If the sale closes in a calendar year in which you are not resident, the question is a U.S. one, and the exclusion usually answers it. If it closes in a Spanish tax year, the two-year window from the day you moved out decides whether Spain taxes the gain or exempts it, and that date belongs in the pre-departure checklist of moving to Spain from the U.S..

For a seller who lived in the home for years, sells in a calendar year in which they are not Spanish residents and stays under the exclusion, the question is in general only the U.S. return, which Publication 523 and Form 8949 describe. Matters change with a sale in a Spanish tax year, a gain above the exclusion, a rental period, a couple in which only one spouse meets the use test, or a Spanish purchase on which the reinvestment exemption depends; those cases call for a cross-border tax professional who files in both countries, whose fee is small next to a two-year window missed by a month.

The Spain Navigator, the app that puts every step of your move to Spain in order, holds the move-out date, the 183-day count and the visa steps in one plan, so that the sale is timed against the same calendar as everything else.

FAQ

If I sell the house in the year I move, will Spain tax the gain?

The sale date does not decide; residency does. More than 183 days in Spain in a calendar year makes you resident for all of it, months before your arrival included, and so does having the core of your economic activities or interests there. The gain is then taxable in Spain, with a deduction for the U.S. tax. In a year in which you are not resident, Spain has no claim.

Can I use the Spanish reinvestment exemption for a house in the United States?

The Agencia Tributaria's conditions turn on habitual residence and do not mention where the home sits; ask a Spanish adviser about a home abroad. The exemption is for taxpayers resident in Spain in the year of the sale. Habitual means three continuous years of living there, with exceptions such as a job transfer. The proceeds must buy a new habitual residence within two years, and you must claim it.

Is the $500,000 exclusion automatic for a married couple?

No. The IRS makes it conditional on a joint return for the year of the sale, on either spouse meeting the ownership test, and on both spouses meeting the use and look-back tests individually (no gain excluded on another home sold in the two years before), as Publication 523 sets out. A couple in which one spouse fails the use test is generally back to $250,000.

Do I have to report the sale if all the gain is excluded?

Yes, in two cases, either of which suffices: receiving Form 1099-S, Proceeds From Real Estate Transactions, or having any part of the gain that cannot be excluded. The IRS side then goes on Form 8949 and Schedule D of Form 1040. Spain keeps its own line for the gain on the IRPF return, so a sale in a Spanish tax year is reported twice, even at zero U.S. tax.

Does the exclusion protect me from the 3.8 percent surtax?

For the excluded part, yes. According to the IRS, net investment income does not include gain on the sale of a personal residence that is excluded from gross income for regular income tax purposes. Whatever gain exceeds the exclusion counts as investment income, and the surtax applies once modified adjusted gross income passes $200,000 for a single filer or $250,000 on a joint return.

I am over 65. Does Spain tax the sale of my former home?

Not if it qualifies as your habitual residence. The Agencia Tributaria exempts the gain when a person over 65 sells it, treating the home as habitual if it was so within the two years before the sale. Since Real Decreto-ley 26/2026 took effect on October 1, 2026, moving to a care center or a relative's home for reasons of age also preserves that status, subject to validation by Congress.

Sources

Official pages this article was checked against, with the date we last read them.

  1. Topic no. 701, Sale of your home Internal Revenue Service, English, retrieved
  2. Net investment income tax Internal Revenue Service, English, retrieved
  3. Income Tax Convention with Spain, with Protocol Internal Revenue Service, English, retrieved
  4. FTB Publication 1031, 2025 Guidelines for Determining Resident Status California Franchise Tax Board, English, retrieved
  5. Contribuyentes por el IRPF (residencia habitual en territorio español), manual IRPF 2025 Agencia Tributaria, Spanish, retrieved
  6. Gravamen estatal de la base liquidable del ahorro, Manual práctico de Renta 2025 Agencia Tributaria, English, retrieved
  7. Gravamen autonómico de la base liquidable del ahorro, Manual práctico de Renta 2025 Agencia Tributaria, English, retrieved
  8. Transmisión de la vivienda habitual con reinversión Agencia Tributaria, Spanish, retrieved
  9. Transmisión de la vivienda habitual por personas mayores de 65 años, Manual específico de Renta 2025 Agencia Tributaria, Spanish, retrieved
  10. Deducción por doble imposición internacional, Manual práctico de Renta 2025 Agencia Tributaria, English, retrieved
  11. Consulta vinculante V1615-25 (venta de vivienda en Estados Unidos, tipo de cambio) Dirección General de Tributos, Spanish, retrieved
  12. Consulta vinculante V0152-26. Acciones estadounidenses en dólares y conversión a euros Dirección General de Tributos, Spanish, retrieved
  13. Ley 35/2006, del Impuesto sobre la Renta de las Personas Físicas, texto consolidado Boletín Oficial del Estado, Spanish, retrieved
  14. Real Decreto 439/2007. Reglamento del Impuesto sobre la Renta de las Personas Físicas, texto consolidado Boletín Oficial del Estado, Spanish, retrieved
  15. Real Decreto-ley 26/2026, de 29 de septiembre, medidas urgentes para la protección de la función social de la vivienda y la ampliación de la oferta de vivienda asequible BOE, Spanish, retrieved
  16. Publication 523 (2025), Selling Your Home Internal Revenue Service, English, retrieved
  17. Instructions for Form 8960 (2025) Internal Revenue Service, English, retrieved

About the author

See author page

Aurelio Maurici is the co-founder of EasyFranceNow and EasySpainNow and the author behind the tax guidance for U.S. and UK nationals in Europe.

He holds a Master's degree in Business Law from Aix-Marseille Université, where his work centered on legal structures, institutional systems and administrative frameworks. Based in Aix-en-Provence, he has spent years working inside the European legal and administrative system on behalf of international clients, handling real files every week: bank account openings and the FATCA-driven restrictions Americans run into, public healthcare onboarding, tax residency and cross-border reporting questions, and the documentary standards institutions apply in practice rather than in theory.

That hands-on work is the foundation of the Spanish guides on this site. He focuses on the points where Spanish administrative logic diverges from what Americans expect: the weight of sequencing, documentary consistency, and how banks, the Agencia Tributaria and the Seguridad Social interpret rules operationally. His guidance is built from primary sources (BOE, agenciatributaria.es, seg-social.es, exteriores.gob.es and the IRS) and updated when procedures change. He writes the tax guides on this site and reviews the money and tax passages of the other writers' guides.

His work is procedural and operational, not a substitute for regulated advice. When a situation calls for a licensed tax or legal professional, he says so plainly and helps coordinate the right one.

Related articles

Guides for Americans

More articles by Aurelio Maurici

View all

Sourced guides for Americans and Britons planning their move to Spain.

Maxime and Aurelio, EasySpainNow's co-founders

Where are you in the move?