Skip to content

General education, not advice for your situation.

Carry Forward Learning Search the site

Selling Your Home

Selling Your Home: partial exclusions and tax on the gain

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

What if I have to move before I've lived there long enough?

You may still get a partial exclusion if the main reason for the sale was a change in the location of your job, your health, or an unforeseen event. The cap is shrunk to match how long you actually lived there.
Sources

Authority, strongest first

  1. Code I.R.C. § 121
  2. Regulation Treas. Reg. § 1.121-3
  3. Publication IRS Publication 523 (2025), Selling Your Home
Section 121(c). The ownership/use tests and the once-every-two-years rule are waived, but the dollar cap is multiplied by a fraction. Webert (T.C. Memo. 2022-32) notes that the numerator counts use of the home as a principal residence, so a taxpayer with no use in the five-year window gets a zero fraction.

How is the partial exclusion figured?

Take the shortest of three periods: how long you owned the home, how long you lived in it (both in the last 5 years), or how long since your last excluded sale. Divide that by 24 months (or 730 days) and multiply by the full cap.
Sources

Authority, strongest first

  1. Code I.R.C. § 121
  2. Regulation Treas. Reg. § 1.121-3
  3. Publication IRS Publication 523 (2025), Selling Your Home
Section 121(c)(1) and Reg. 1.121-3(g). For joint filers who both qualify, the fraction is applied to the joint cap; where only one spouse has the shorter period, compute each spouse separately (Reg. 1.121-3(g)(2) Example 2).

What's the distance rule for a job change?

If your new job is at least 50 miles farther from the home than your old job was (or at least 50 miles from the home if you had no job), the IRS treats the sale as work-related without asking why you moved. It's a safe harbor, not the only way: a closer job can still count if the job was the main reason for the sale. This isn't the old moving-expense deduction. That deduction has been suspended for most people for tax years after 2,017, and Congress made the suspension permanent in 2025 (military members and, new in 2025, intelligence community employees are the exceptions). It has no effect on this rule either way.
Sources

Authority, strongest first

  1. Code I.R.C. § 217(k)
  2. Session law Pub. L. 119-21 § 70113
  3. Regulation Treas. Reg. § 1.121-3
Reg. 1.121-3(c)(2)(i)-(ii) (the 50-mile test is in (c)(2)(ii)) and the examples at (c)(4). This distance test is its own rule in the section 121 regulations. It is not the moving-expense deduction under section 217. Section 217(k) now reads 'beginning after December 31, 2017' with no end date (P.L. 119-21 section 70113(a)), and section 217(k)(2) treats intelligence community employees like military members (section 70113(b)).

What counts as a health reason?

Moving to get, give or make easier medical care or treatment for a disease, illness or injury. That can be for you or a family member. A doctor's recommendation to move to treat or ease an illness or injury is a safe harbor. A move that's merely good for your general well-being doesn't count.
Sources

Authority, strongest first

  1. Regulation Treas. Reg. § 1.121-3
  2. Publication IRS Publication 523 (2025), Selling Your Home
Reg. 1.121-3(d)(1)-(3). Example 5 denies a partial exclusion where the move was merely beneficial to general well-being (more golf). Qualified individuals for health include relatives listed in (f)(5).

What counts as an unforeseen circumstance?

The rules list events that count automatically: your home being destroyed or condemned, a disaster damaging it, a death, a divorce or legal separation, having twins or more, losing a job so you qualify for unemployment, or a change in work that leaves you unable to afford basic costs. Other surprises can count too, but wanting a nicer home or earning more money never does. If your situation isn't on the list, the unexpected event has to be the main reason you sold, judged on all the facts. Things that help: the sale came soon after the event, you couldn't have seen it coming, and the home stopped working for you or became hard to afford.
Sources

Authority, strongest first

  1. Regulation Treas. Reg. § 1.121-3
  2. Notice Notice 2002-60
Reg. 1.121-3(e)(1)-(3). The Commissioner may designate other events in published guidance; Notice 2002-60 did so for taxpayers affected by September 11, 2001. Examples 7, 8 and 10 show that an improvement in financial circumstances disqualifies even an unforeseen event. For events off the list, Reg. 1.121-3(b) lists six factors (proximity in time, a material change in suitability, impaired ability to maintain the property, use of the property as the taxpayer's residence, reasonable foreseeability and timing within the ownership period).

How is the gain above the cap taxed?

It's long-term capital gain if you owned the home more than 12 months, taxed at 0%, 15% or 20% depending on your income. The part that comes from depreciation is taxed at up to 25%. Taxable gain can raise what you owe for the year, so ask whether more withholding or an estimated payment makes sense to avoid an underpayment penalty.
Sources

Authority, strongest first

  1. Code I.R.C. § 1(h)(1)(E), (h)(6)
  2. Publication IRS Publication 523 (2025), Selling Your Home
Net capital gain rates are in section 1(h); unrecaptured section 1250 gain is defined in 1(h)(6) and taxed at the maximum rate in 1(h)(1)(E). Pub. 523 says the sale is reported as short- or long-term on Form 8949 depending on how long you owned the home, and that a taxable gain may call for more withholding or estimated payments (Pub. 505).

Does the net investment income tax apply?

Not to gain you exclude, because the 3.8% tax only counts gain that's included in taxable income. It can apply to gain above the cap if your income is over $200,000 (single) or $250,000 (joint).
Sources

Authority, strongest first

  1. Code I.R.C. § 1411(a), (b), (c)(1)(A)(iii)
Section 1411(c)(1)(A)(iii) takes net gain into account only 'to the extent taken into account in computing taxable income', so section 121 gain is outside net investment income. The thresholds are in 1411(b) and are not indexed.

Why would anyone choose not to use the exclusion?

If you expect to sell another home within 2 years at a much bigger gain, you might save the exclusion for that sale. You make the choice by reporting the gain, and you can change your mind within 3 years of the due date of the return.
Sources

Authority, strongest first

  1. Code I.R.C. § 121
  2. Regulation Treas. Reg. § 1.121-4
  3. Publication IRS Publication 523 (2025), Selling Your Home
Section 121(f) and Reg. 1.121-4(g). Pub. 523 describes the amended-return path to undo the election.

More questions

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: election change window years
    Treas. Reg. 1.121-4(g) 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: 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
  • Moving expense 217: civilian deduction suspended after year
    IRC 217(k)(1); P.L. 119-21 sec. 70113 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
  • Payroll and SE tax: niit rate
    26 U.S.C. sec. 1411(a)(1) checked 2026-09-24, review by 2027-01-22
  • Payroll and SE tax: niit threshold MAGI, married filing jointly and surviving spouse
    IRS Net Investment Income Tax page; 26 U.S.C. sec. 1411(b) checked 2026-10-12, review by 2027-02-09
  • Payroll and SE tax: niit threshold MAGI, single and head of household
    IRS Net Investment Income Tax page; 26 U.S.C. sec. 1411(b)(3) checked 2026-10-12, review by 2027-02-09