A house held for forty years has a gain. The date of a spouse's death can change what escapes it.
Federal law excludes a large slice of the gain on a main home from income altogether. The two year test, the window that keeps the larger amount alive after a death, the provision written for a move into residential care, and the partial exclusion almost everyone reads backwards.
Updated September 2026, 32 minute read
What changed: 2026-09-05: First published.
Contents (9 sections)
- 1.A house held for forty years has a gain. The date of a spouse's death can change what escapes it.
- 2.Two hundred and fifty thousand, five hundred thousand, and what the larger one requires
- 3.The two year window after a spouse dies Members only
- 4.The adjustment that often makes the exclusion unnecessary Members only
- 5.A move into a care facility does not break the test Members only
- 6.Falling short of two years is not all or nothing Members only
- 7.The parts of the gain the exclusion does not reach Members only
- 8.The one afternoon checklist Members only
- 9.Where these rules come from Members only
Section 1 of 9, about 30 minutes left
Part 1. A house held for forty years has a gain. The date of a spouse's death can change what escapes it.
A house bought decades ago and sold now has a gain, and the gain is often far larger than the household expects, because it is measured against what was paid rather than against anything that feels like recent value.
Federal tax law then does something unusual with that gain. It does not tax it at a lower rate. It excludes it from gross income entirely, up to a limit, where a set of conditions is met.
The core rule is one sentence. Gross income does not include gain from the sale of property if, during the five year period ending on the date of the sale, the property was owned and used as the taxpayer's principal residence for periods aggregating two years or more.
Three things about that sentence are worth noticing straight away. The two years do not have to be consecutive, because the test is periods aggregating two years. They do not have to be the most recent two, because the window is the whole five years. And ownership and use are separate requirements that both have to be satisfied, though not necessarily at the same moments.
These are federal rules and they apply the same way in every state. One important rule described in Part 4 is federal but depends on state property law for its result, and that is flagged where it arises. This guide is educational information. It is not legal, tax or financial advice, and it does not tell anyone when to sell anything.
Part 2. Two hundred and fifty thousand, five hundred thousand, and what the larger one requires
The excluded amount is capped. For a single filer the cap is $250,000 of gain. On a joint return it can be $500,000, but only where three conditions all hold.
- Either spouse meets the ownership requirement.
- Both spouses meet the use requirement.
- Neither spouse is disqualified by having used the exclusion on another sale within the last two years.
The asymmetry in the first two lines is the whole design. Ownership can sit with one spouse alone, which covers a house that was never retitled after a marriage. Use cannot: both people have to have lived there for the required period.
What happens when the three are not all met
Failing them does not drop a couple to the single figure. Federal law says the limit is then the sum of what each spouse would have been entitled to had they not been married, and for that purpose each is treated as owning the property during any period either of them owned it. Depending on which spouse meets which test, that lands somewhere between the two headline figures rather than automatically at the lower one.
The once every two years limit
The exclusion is not available at all where, during the two year period ending on the date of the sale, there was another sale to which it applied. It is a limit on frequency rather than a lifetime allowance, and it resets.
Two more structural points. The exclusion applies automatically: federal law says the section applies unless the taxpayer elects for it not to, so it is not something that has to be claimed to exist.
And ownership periods can be inherited in one other situation. Where a home was transferred between spouses or former spouses in a transfer that federal law treats as tax-free, the recipient's ownership period includes the transferor's, which matters where a house changed hands on a divorce.
You have read 2 of 9 sections.
The remaining 7 open with a membership.
- Every guide in the library.
- A printable PDF and a one-afternoon checklist for each one.
- Updates whenever the rules change, at no extra cost.
That works out to $1.67 a month.
Pay $2.99 a month insteadCancel any time from your account page, in one click.
The charge appears on your statement as HEAVENLYFINANCEGUIDES.
No advertising. We never sell your information.
Already a member? Sign in
Not right now? Read the free guides.
- The two year window after a spouse dies
- The adjustment that often makes the exclusion unnecessary
- A move into a care facility does not break the test
- Falling short of two years is not all or nothing
- The parts of the gain the exclusion does not reach
- The one afternoon checklist
- Where these rules come from
About 26 minutes of reading left.
Part 3. The two year window after a spouse dies Members only
The larger amount is normally a joint return rule, so it would ordinarily disappear with the marriage. Federal law keeps it alive for a defined period, and the period is short.
Part 4. The adjustment that often makes the exclusion unnecessary Members only
Before asking how much gain is excluded, it is worth asking how much gain there is. Property inherited from someone takes a new starting figure, and in some states a surviving spouse's own half does too.
Part 5. A move into a care facility does not break the test Members only
The five year window would ordinarily run out on someone who left home for residential care. Federal law contains a specific provision saying it does not.
Part 6. Falling short of two years is not all or nothing Members only
There is a partial exclusion, and almost every description of it gets the arithmetic backwards. The fraction is applied to the limit, not to the gain.
Part 7. The parts of the gain the exclusion does not reach Members only
Two carve-outs sit inside the rule. Both are about periods when the house was something other than a home, and both have dates attached.
Part 8. The one afternoon checklist Members only
Fourteen things to establish before a house is sold, most of them about dates.
Part 9. Where these rules come from Members only
The Internal Revenue Code itself, section by section.