Skip to content

General education, not advice for your situation.

Carry Forward Learning Search the site

Topic hub

Selling Your Home: The Section 121 Exclusion Explained

For anyone selling a home they live in, or used to: will the gain be taxed, how to figure it, and what to file, in plain words with the law behind each answer.

Pick your situation

Pick your situation

In 60 seconds

  • If you owned the home and lived in it as your main home for 2 of the last 5 years, you can leave up to $250,000 of gain out of your income, or $500,000 on a joint return when both of you pass the use test.
  • The cap is about gain, not price: the sale price, minus selling costs, minus what you paid and put into the house.
  • Have to sell sooner because of a job change, your health or an unexpected event? You may still get part of the cap.
2 more points
  • Rental time and depreciation can make part of the gain taxable even when you pass the tests. Divorce, a spouse's death and military service have their own rules, usually in your favor.
  • Got a Form 1099-S? Report the sale on Form 8949 even if all the gain is excluded. Section 121 itself did not change for 2026.
Or answer a few questions to get your steps

Step 1 of 6

In the years before the closing, did you own the home and live in it as your main home long enough?

Learn it9Numbers · Pictures · Basics · Steps · Examples · Mistakes

Key numbers

Most gain you can leave out, single
$250,000Also married filing separately. Fixed in the law, so it doesn't rise with inflation.26 U.S.C. sec. 121(b)
Most gain you can leave out, married filing jointly
$500,000When either spouse passes the ownership test, both pass the use test, and neither used the exclusion in the last 2 years.26 U.S.C. sec. 121(b)
Years you need to have owned the home and lived in it
2Inside the last 5 years: 24 months or 730 days of each. They don't have to be in a row, or the same years.IRC 121(a)Checked
Years to wait between excluded sales
2Counted back from the closing date. A reduced exclusion can still apply.IRC 121(b)(3)Checked
Miles farther your new job must be to qualify for a partial exclusion
50A shorter distance can still count if the job was the main reason for the sale.Treas. Reg. 1.121-3(c)(2)(ii)Checked
Top tax rate on the slice of gain from depreciation
25%Other taxable gain on a home owned more than 12 months: 0%, 15% or 20%.26 U.S.C. sec. 1(h)

Figures checked against the source unless a card says otherwise.

The short explainer

If you sell your main home, you can leave up to $250,000 of gain out of your income, or up to $500,000 on a joint return if one of you meets the ownership test and both of you meet the use test. For most sellers that means no tax and no reporting.

You qualify if you owned the home and lived in it as your main home for 2 years or more during the 5 years before the sale. The years don't have to be consecutive, and owning and living there don't have to be the same 2 years.

The tests are where people trip. A job move, health problem or unforeseen event can still earn a partial exclusion. Time as a rental on or after January 1, 2009, and depreciation after May 6, 1997, can make part of the gain taxable even when you pass the tests.

Divorce, a spouse's death and military service each have their own rules, usually in your favor. Your basis (what you paid plus improvements) decides how big the gain is, so keep the records.

A Form 1099-S means you report the sale on Form 8949, even if the whole gain is excluded. No form doesn't mean no duty if part of the gain is taxable.

As of Dec 1, 2026. Editorial review: Carry Forward Learning (AI-assisted) Oct 21, 2026.

In pictures

This flowchart asks four questions to show whether you can leave your home sale gain out of income.
Four questions, asked about the day of the sale.
Describe this diagram

This flowchart asks four questions to show whether you can leave your home sale gain out of income. Flowchart: can I leave my home sale gain out of my income? Four gate cards asked about the day of the sale: did you own the home for two of the last five years; did you live in it as your main home for two of the last five years, which need not be in a row; did neither you nor your spouse use the exclusion on another home sale in the last two years; and is any of the gain from depreciation, rental time or a separate unit. Passing the first three leads to you qualifying, up to the cap for single or joint filers. A no to the first two, or a yes to using the exclusion recently, leads to a shared box asking whether you sold mainly because of a job change, health or an unforeseen event; if yes you can get a reduced exclusion, figured as the cap times the shortest of months owned, months lived there and months since the last excluded sale, as a share of the full qualifying period, and if no you get none. On the last question, only time after the nonqualified-use start date when the home was not your main home before you moved in or between stretches of use counts, renting after you move out does not, and depreciation taken after the 1997 cutoff is taxed; that slice is taxable and the rest fits under the cap. A footnote covers Form 1099-S and Form 8949, and says a loss is not deductible.

Timeline titled the look-back window: five year columns ending at a closing-date marker.
Two years of owning and two years of living there, inside the five years before you sell. They don't have to line up.
Describe this diagram

Timeline titled the look-back window: five year columns ending at a closing-date marker. An owned bar runs across all five years, and two years is enough. The lived-there bar is drawn as two separate year blocks with a note that two years in pieces works and one stretch works too. A look-back bracket spans the five years. A dashed extended-duty band with a left arrow shows that members of the uniformed services, Foreign Service, intelligence community and Peace Corps can stretch the window by up to ten years with an election. Notes cover the repeat-sale rule and say a surviving spouse who has not remarried gets two years after the death to use the joint cap, if the joint tests were met right before the death.

These cards compare home sale situations and the exclusion each one gets.
The cap depends on who is selling and who passes the tests.
Describe this diagram

These cards compare home sale situations and the exclusion each one gets. Five stacked cards compare home sale situations: single or married filing separately, joint with both spouses passing the tests, joint with one spouse failing the use test (up to the single cap plus an add-on line), a surviving spouse selling in time, and a reduced exclusion. Each shows a big cap number and one set of row labels for who must own the home, who must live in it and other limits, with a legend for a check needed, a wave for depends and a bar for a limit; the reduced card says the exclusion can be based on less than two years.

The basics

What it is

A rule in section 121 of the Internal Revenue Code that excludes gain on the sale of your principal residence, up to a dollar cap, if you meet an ownership test and a use test.

What makes it special

It's one of the few places the tax law simply ignores a large gain. There's no age requirement, no reinvestment requirement, and you can use it again after a short wait.

Who's allowed

Owners who lived in the home as their main home for 2 of the last 5 years. Co-owners, spouses, trusts that you're treated as owning, and co-op shareholders can qualify.

What it doesn't cover

Gain from depreciation after May 6, 1997, gain from time the home wasn't your main home on or after January 1, 2009, a separate rental or business unit, and any loss (a loss on your own home isn't deductible).

Step by step

  1. Pin down your dates

    Find your closing date (the date of sale) and work back 5 years. Count how many months you owned the home and how many you lived in it as your main home.

    Where it goes: Closing disclosure; Form 1099-S, box 1 shows the closing date

  2. Check the tests

    You need 2 years of each, and no other excluded sale in the last 2 years. If a test fails, look at the partial exclusion.
  3. Figure your gain

    Amount realized (price minus selling costs) minus adjusted basis (cost plus closing costs plus improvements, minus depreciation and credits).

    Where it goes: Pub. 523, Worksheet 2

  4. Take out depreciation and rental time

    Gain up to depreciation after May 6, 1997 isn't excludable, and gain tied to nonqualified use on or after January 1, 2009 isn't either.

    Where it goes: Pub. 523, Worksheet 3

  5. Apply the cap

    Exclude up to $250,000 (or $500,000 on a joint return that qualifies). Anything over is taxable.

    Where it goes: Pub. 523, Worksheet 1

  6. Report if you need to

    If you got a Form 1099-S, or part of the gain is taxable, report the sale on Form 8949 and Schedule D. Business or rental portions go on Form 4797.

    Where it goes: Forms 8949, Schedule D, 4797

Worked examples

Mistakes and traps

Compare

Side by side has its own page, so this one stays quick to load.

Open side by side

Rules in depth

Quick recap

Quick recap has its own page, so this one stays quick to load.

Open quick recap

Do it6Walk me through · Scenarios · Timeline · Playbook · Checklist · Dates

Walk me through it: will my home sale gain be taxed?

Answer up to 6 quick questions and get the steps for your situation. Nothing is sent anywhere.

Step 1 of 6 In the years before the closing, did you own the home and live in it as your main home long enough?

This first question sits at the top of the page. Go to the first question.

Step 2 of 6 Did you exclude gain from selling another home in the last couple of years?

The exclusion can't be used again if you used it on another sale within 2 years before this one, unless a reduced exclusion applies.

Step 2 of 6 Are you selling because of a job change, your health, or an unexpected event?

These reasons can earn a partial exclusion even when the full tests are not met. Wanting a nicer home or a higher income never counts.

Step 3 of 6 Does one of these apply to you?

Divorce, a spouse's death and some government service each change how the tests are counted, usually in your favor.

Step 4 of 6 How will you file for the year of the sale?

The cap is $250,000 for a single filer and $500,000 on a joint return when the couple meets the extra tests.

Step 5 of 6 Did both spouses live in the home as their main home for the required time?

On a joint return, only one spouse needs to meet the ownership test, but both must meet the use test for the larger cap.

Step 5 of 6 Was any of the home rented out or used for business, or is any part a separate rental unit?

Depreciation after May 6, 1997 and rental time on or after January 1, 2009 can make part of the gain taxable even when you pass the tests.

Start to finish, with numbers

Start to finish, with numbers has its own page, so this one stays quick to load.

Open start to finish, with numbers

Timeline

Timeline has its own page, so this one stays quick to load.

Open timeline

The playbook, start to finish

The playbook, start to finish has its own page, so this one stays quick to load.

Open the playbook, start to finish

Do this next

  • Write down your closing date and count back 5 years. Mark the months you owned the home and the months you lived in it as your main home.
  • Married? Do the same count for each spouse, and note any sale of another home in the last 2 years.
  • Pull your basis records: the closing statement from when you bought, and receipts for improvements.
  • List any rental time, home office years or a separate rental unit, with the depreciation you took.
  • Work out the gain: price, minus selling costs, minus adjusted basis (Pub. 523, Worksheet 2).
  • Compare the gain with your cap, then carve out depreciation and rental time.
  • Got or expecting a Form 1099-S? Plan to report the sale on Form 8949.
  • Keep the closing statement, basis records and the 1099-S in one folder.

Notices and key dates

Notices and key dates has its own page, so this one stays quick to load.

Open notices and key dates

Questions3Q&A · Quiz · Words

Questions and answers

70 questions, each answered in a few sentences with the authority behind it. Pick a group, or search.

The basics (10)

Read the 10 answers

Who qualifies and which home counts (9)

Read the 9 answers

Partial exclusions and tax on the gain (8)

Read the 8 answers

Basis and your gain (9)

Read the 9 answers

Rentals, home offices and depreciation (9)

Read the 9 answers

Divorce, death, military and other cases (7)

Read the 7 answers

Forms and filing (8)

Read the 8 answers

Common questions from real situations (10)

Read the 10 answers

Test yourself

  • 13 questions, each with the answer and the rule behind it.

Take the quiz

Words used here

Words used here has its own page, so this one stays quick to load.

Open words used here

The law3The law · Authority · Forms

The law

The law, section by section has its own page, so this one stays quick to load.

Open the law, section by section

Authority stack

38 sources, ranked by weight: the Code first, then session laws and regulations, IRS guidance, cases, then publications and forms. The Code, session laws and regulations are here; the rest, with what each one says paragraph by paragraph, is on the full authority page.

IRS forms and publications

IRS forms and publications has its own page, so this one stays quick to load.

Open irs forms and publications

More2Read · Changes

Same facts. Pro adds the full authority stack under each answer.

Where the numbers come from

Checked

Every figure above comes from the source listed here, with the date we checked it and the date it is due for a re-check.

  • Capital gains: long term holding more than months
    IRC 1222(3) checked 2026-10-19, review by 2027-01-19
  • Home sale: depreciation cutoff date
    IRC 121(d)(6) checked 2026-10-19, review by 2027-01-19
  • Home sale: employment safe harbor miles
    Treas. Reg. 1.121-3(c)(2)(ii) checked 2026-10-19, review by 2027-01-19
  • Home sale: nonqualified use start date
    IRC 121(b)(5)(C)(i) checked 2026-10-19, review by 2027-01-19
  • Home sale: ownership use test days
    Treas. Reg. 1.121-1(c)(1) checked 2026-10-19, review by 2027-01-19
  • Home sale: ownership use test years
    IRC 121(a) checked 2026-10-19, review by 2027-01-19
  • Home sale: repeat sale lookback years
    IRC 121(b)(3) checked 2026-10-19, review by 2027-01-19
  • Capital gains: rates
    26 U.S.C. sec. 1(h) checked 2026-09-24, review by 2027-01-22
  • Home sale exclusion: maximum gain excluded
    26 U.S.C. sec. 121(b) checked 2026-09-24, review by 2027-01-22