What Section 121 Is
Internal Revenue Code Section 121 — formally titled "Exclusion of gain from sale of principal residence" — lets a qualifying homeowner exclude a substantial amount of capital gain on the sale of their primary home from federal taxable income.
To qualify for the full exclusion, you generally must have owned and used the home as your principal residence for periods totaling at least 2 years out of the 5-year window ending on the sale date. The exclusion is also generally limited to once every 2 years.
This is sometimes loosely called "the home sale capital gains exemption," but that label oversells it. Section 121 is an exclusion up to a cap, not a blanket exemption — gain above the cap, depreciation recapture, and certain disqualifying use periods can still create a tax bill.
Authoritative source: IRS Topic No. 701 — irs.gov/taxtopics/tc701. The detailed rules, worksheets, and examples live in IRS Publication 523, "Selling Your Home."
A Quick History — Why the Rule Looks the Way It Does Today
Section 121 was originally added to the Internal Revenue Code in 1964, but the version most homeowners know today was substantially rewritten by the Taxpayer Relief Act of 1997.
Before 1997, the federal rules looked very different:
- Old Section 1034 rollover rule: If you sold a home and bought another of equal or greater value within a set time window, you could roll over (defer) the gain. The tax just kept following you forward.
- Once-in-a-lifetime age-55 exclusion: Homeowners aged 55+ got a single, lifetime exclusion of up to $125,000 of gain on a primary residence sale.
The 1997 rewrite scrapped both of those and replaced them with the modern $250K / $500K recurring exclusion tied to ownership and use of a principal residence — no requirement to buy a replacement home, and no age requirement.
Why this history matters: Many sellers still vaguely remember being told they have to "buy another house to avoid the tax." That has not been the federal rule since 1997. Today's Section 121 is about ownership, use, and the 2-year look-back — not about reinvesting the proceeds.
The 2-Out-of-5-Year Rule, Broken Down
To claim the maximum Section 121 exclusion, you generally need to satisfy three tests in the 5-year period ending on the date of sale:
1. Ownership Test
You must have owned the home for at least 24 months (in total) during the 5-year period.
2. Use Test
You must have used the home as your main home for at least 24 months (in total) during the same 5-year period.
3. Look-Back / Frequency Test
You must not have excluded gain from the sale of another principal residence during the 2-year period ending on the date of this sale.
The 24 months of ownership and 24 months of use do not have to be the same 24 months, and they do not have to be continuous. Short, temporary absences (vacations, work travel) generally still count as use.
For married couples filing jointly to get the full $500,000 exclusion, additional joint-return conditions apply — at least one spouse must meet the ownership test, both spouses must meet the use test, and neither spouse can have excluded gain on another home in the prior 2 years.
What the IRS Considers a "Main Home"
If you only own one home and live in it, this is straightforward. If you own more than one residence — say a primary plus a vacation home, or a primary and a snowbird condo — the IRS treats the "main home" question as a facts-and-circumstances analysis.
Factors the IRS looks at include:
- The address you use on your federal and state tax returns
- The address on your driver's license and voter registration
- Where you actually spend the majority of your time
- Where you work (or where your business is based)
- Where your immediate family members live
- The address on your bank and brokerage statements
- The address used for car registrations and club memberships
If you split time between two homes, only one can be your principal residence at any given time. Your records should be internally consistent — you do not want your tax return saying one home and your driver's license saying another.
Important Exceptions and Common Traps
Section 121 is generous, but it is not a blanket "no tax on home sales" rule. The most common ways homeowners get tripped up:
Depreciation Recapture (post–May 6, 1997)
If you ever rented the home out, used part of it as a home office, or otherwise took depreciation deductions on the property, the gain attributable to depreciation taken after May 6, 1997 is generally not excluded under Section 121. That portion of the gain is typically taxed as unrecaptured Section 1250 gain, currently capped at a 25% federal rate.
Periods of "Nonqualified Use"
For sales after January 1, 2009, gain attributable to periods when the home was not being used as a principal residence (for example, years when it was a rental) generally does not qualify for the exclusion. The gain has to be allocated between qualifying and nonqualifying use periods.
Like-Kind Exchange Lookback
If you acquired the home in a Section 1031 like-kind exchange, you generally cannot use Section 121 on the sale unless you have owned the property for at least 5 years after the exchange. This is meant to stop investors from converting investment property into a primary residence and immediately washing the gain through Section 121.
Other Common Traps
- Inherited or gifted homes: Cost basis rules differ — inherited property typically gets a stepped-up basis at death, while gifted property generally carries over the donor's basis.
- Married filing jointly issues: If only one spouse meets the ownership test but the other does not meet the use test, the couple may be limited to the $250,000 single-filer cap rather than $500,000.
- Vacant land sold separately: Land adjacent to your home can sometimes qualify, but generally only if it was used as part of the residence and is sold within 2 years before or after the dwelling.
- Business / rental use of part of the home: If a discrete portion of the property was used purely for business and never converted back to personal use, gain on that portion may not be excludable.
Special Rules That Can Help
The statute and IRS guidance also provide specific accommodations for:
- Surviving spouses — under certain conditions, a surviving spouse can claim the full $500,000 exclusion if the home is sold within 2 years of the deceased spouse's death.
- Divorce situations — special ownership and use attribution rules can help one spouse claim the exclusion after a divorce.
- Active-duty military, Foreign Service, and certain federal intelligence employees — the 5-year lookback period can be suspended for up to 10 years of qualified extended duty.
- Taxpayers who become physically or mentally incapable of self-care — time spent in a licensed care facility can count toward the use test.
Partial Exclusions — When You Don't Quite Meet the Tests
A homeowner who fails the full 2-out-of-5-year test may still qualify for a reduced (partial) exclusion if the sale was primarily because of one of three IRS-recognized reasons:
1. Work-Related Move
A change in place of employment that meets specific distance and timing tests — generally, the new job has to be at least 50 miles farther from the old home than the old job was.
2. Health
A move to obtain, provide, or facilitate the diagnosis, cure, mitigation, or treatment of a disease, illness, or injury — for the homeowner, a spouse, a co-owner, or another qualifying family member.
3. Unforeseeable Events
Specific events the IRS treats as qualifying — such as natural or man-made disasters, certain involuntary conversions, multiple births from a single pregnancy, divorce or legal separation, death, change in employment status that leaves the household unable to pay basic expenses, and other facts-and-circumstances events.
A partial exclusion is calculated by taking the maximum exclusion ($250K or $500K) and multiplying by a fraction — the shorter of (a) time you owned the home, (b) time you used the home as a main home, or (c) time since your last excluded sale — over 2 years (730 days).
Worked example: A married couple lived in their home for 12 months before a job-related relocation forced a sale. Their maximum partial exclusion would be $500,000 × (12 / 24) = $250,000 of gain potentially excludable, even though they did not meet the full 2-year use test.
Partial-exclusion math is sensitive to facts and dates. Run the actual numbers with a CPA before relying on a partial exclusion in any sale plan.
Frequently Asked Questions
Related Tool: Florida Net Seller Calculator
Section 121 tells you what the IRS will (and won't) tax. The next question every Florida seller asks is "how much do I actually walk away with at the closing table?" Run the numbers on commissions, doc stamps, prorations, and payoff with our Florida Net Seller calculator.
Thinking About Selling? Talk to Todd Before You Do.
Section 121 is one of the largest single tax breaks in the federal code — and one of the easiest to accidentally disqualify yourself from. Before you list, let's run the actual numbers, look at the timing, and coordinate with your CPA.
Compliance & Sources
This is general educational information about IRC §121, not tax or legal advice. Tax outcomes depend on your specific facts, filing status, basis history, prior depreciation, and state of residence. Before relying on any rule discussed here, consult a CPA, Enrolled Agent, or tax attorney about your situation. Todd Hanley and the Todd Hanley Mortgage Team do not provide tax or legal advice.
Primary sources referenced on this page:
- 26 U.S.C. §121 — Exclusion of gain from sale of principal residence
- IRS Topic No. 701, Sale of Your Home — irs.gov/taxtopics/tc701
- IRS Publication 523, Selling Your Home — irs.gov/publications/p523
- Taxpayer Relief Act of 1997 (Pub. L. 105-34) — the 1997 rewrite of Section 121