Do You Owe Capital Gains Tax When You Sell Your Home?

13 min read

120
Do You Owe Capital Gains Tax When You Sell Your Home?

Often not. When you sell your main home, federal law lets you exclude up to $250,000 of capital gain from income ($500,000 on a joint return) if you owned and lived in the home for at least 24 months of the five years before the sale. Capital gains on a home sale above that amount, or on a home that fails the tests, are taxable. A sale can also need to be reported to the IRS when no tax is owed.

Key takeaways

  • The exclusion is $250,000 for a single seller and $500,000 for married couples filing jointly, but only if the ownership and use tests are both met within the five years before the sale and no other home sale used the exclusion in the last two years.
  • The gain is the amount you realize (price minus selling costs) minus your basis (purchase price, certain closing costs and capital improvements), not the price minus what you still owe on the mortgage.
  • Falling short of two years can still earn a reduced exclusion when the sale is caused by a work move, a health need or a qualifying unforeseen event.
  • Depreciation claimed after May 6, 1997 for a home office or rental use cannot be excluded and is taxed at up to 25%.
  • A Form 1099-S, or any taxable gain, means the sale goes on Form 8949 and Schedule D, even if the whole gain is excluded.

Capital gains on home sale basics

The exclusion comes from section 121 of the Internal Revenue Code and applies to a home you use as your main home. IRS Topic no. 701 and Publication 523 set out the conditions as of November 2026. Publication 523 (2025) is written for 2025 returns; a sale in 2026 is reported on the 2026 return filed in 2027, and the IRS pages checked for this article describe the same $250,000 and $500,000 limits.

Taxable gain is figured in two steps. First you find the gain, then you subtract the exclusion you qualify for. Only what is left is taxed.

Amount realized = sale price - selling expenses
Adjusted basis  = purchase price + certain closing costs + capital improvements
Gain            = amount realized - adjusted basis
Taxable gain    = gain - exclusion (never below 0)
  • Selling expenses are costs directly tied to the sale, such as commissions, advertising and legal fees.
  • Capital improvements add value or extend the life of the home, such as an addition or a new roof. Routine repairs and maintenance do not count, and energy credits you received for an improvement reduce its basis.
  • Exclusion is up to $250,000, or $500,000 on a joint return that meets the tests below.

A loss on a main home is not deductible, so a sale below your basis produces no tax benefit (Publication 523).

The ownership and use tests

Both tests look at the five years ending on the sale date, and the 24 months for each test do not have to be the same months, or consecutive.

  • Ownership: you owned the home for at least 24 months in that window. On a joint return, only one spouse has to meet it.
  • Use: you lived in it as your main home for at least 24 months (730 days). On a joint return, each spouse must meet it individually to get the full $500,000.
  • Two-year look-back: you generally cannot use the exclusion if you excluded gain on another home sold within the two years before this sale.

Publication 523 also lists automatic disqualifications: a home acquired in a like-kind (section 1031) exchange within the past five years, and sellers who are subject to expatriate tax. Special rules exist for three groups.

  • Divorce or separation: time a spouse or ex-spouse owned a home transferred to you counts as your ownership, and while you own the home, you can count time a spouse or ex-spouse lived there under a divorce or separation instrument as your use.
  • Surviving spouses: an unmarried survivor can still use the $500,000 limit if the home is sold no later than two years after the spouse’s death and the joint-return conditions were met immediately before the death, under 26 U.S.C. 121(b)(4).
  • Service away from home: members of the uniformed services, the Foreign Service and the intelligence community on qualified official extended duty, and Peace Corps employees and volunteers serving outside the US, can elect to suspend the five-year period for up to 10 years. Qualified duty generally means orders for more than 90 days or an indefinite period at a duty station at least 50 miles from the home, or living in government quarters under orders (Topic no. 701, Publication 523).

When you fall short of two years

If you do not meet the tests because of a work-related move, a health-related move or an unforeseeable event, you can claim a reduced exclusion. Publication 523 gives examples: a new job at least 50 miles farther from the home than the old workplace; a move to get a diagnosis or treatment for yourself or a family member, or on a doctor’s recommendation; and unforeseeable events such as the home being destroyed or condemned, or damaged in a disaster or act of terrorism. Death, divorce or legal separation, the birth of two or more children from the same pregnancy, becoming eligible for unemployment compensation, or a change in employment that leaves the household unable to pay basic living expenses also count when they happen to you, your spouse, a co-owner or anyone else who lived in the home. The job move can likewise be that of a spouse, a co-owner or anyone else who lived in the home. The reason has to be what caused the sale; leaving early for other reasons does not qualify.

The reduced limit uses the shortest of three periods: how long you lived in the home in the five-year window, how long you owned it, and the time since you last excluded a home sale (if any). That period is divided by 730 days (or 24 months) and multiplied by $250,000. For a joint return, the same steps are repeated for the spouse and the two results are added.

Reduced exclusion = (shortest period in months / 24) x $250,000

Illustrative example (hypothetical numbers): a single owner who owned and lived in the home for 18 months before a qualifying job move has a maximum exclusion of 18 / 24 x $250,000 = $187,500. A married couple who both lived there 18 months would each compute $187,500 and add them, for a limit of $375,000. The result is a cap: a gain below it is excluded in full, and only gain above it is taxable.

A worked gain calculation

Illustrative example (hypothetical numbers, not a real sale). A single seller who passes both tests sells for $650,000 after buying for $280,000.

Line Amount How it is reached
Sale price $650,000 Assumed
Selling expenses $40,000 Assumed commission and fees
Amount realized $610,000 $650,000 - $40,000
Adjusted basis $320,000 $280,000 purchase + $4,000 closing costs + $36,000 improvements
Gain $290,000 $610,000 - $320,000
Exclusion $250,000 Single seller, tests met
Taxable gain $40,000 $290,000 - $250,000

If the same house had belonged to a couple filing jointly, the $500,000 limit would exceed the $290,000 gain and none of it would be taxable. In the single case, $40,000 is taxed. If the home was owned for more than one year, that is a long-term gain. Short-term gains (held one year or less) are taxed as ordinary income, according to IRS Topic no. 409. If the 15% rate applied to all of it, the federal tax would be $6,000, but the actual rate depends on total taxable income, covered below.

Depreciation and the home office

The exclusion does not shelter depreciation you claimed, or were allowed to claim, after May 6, 1997 on a home office or rental use. Publication 523 says that portion of the gain must be recaptured, and its example of an office inside the house treats it as unrecaptured section 1250 gain reported through Form 4797, while the rest of the gain can still be excluded. A separate structure used for business, or a rental portion outside your living area, is treated differently: the gain allocated to that part generally cannot be excluded at all, and it is reported on Form 4797.

Illustrative example (hypothetical numbers): a home sale produces a $100,000 gain, of which $6,000 reflects depreciation taken on a home office. Under the rule above, $94,000 can be excluded if the tests are met, and $6,000 is unrecaptured section 1250 gain, taxed at a maximum 25% rate, which is up to $1,500 (IRS Topic no. 409).

Renting the house or using it as something other than a main home after 2008 can also reduce the excludable gain. Publication 523 treats periods after 2008 when the property was not your principal residence as "nonqualified use," and the gain allocated to those periods may not be excluded. The exceptions matter: time after you last lived in the home that falls within the five-year window does not count, so moving out and renting the house before selling it inside that window does not shrink the exclusion (depreciation on the rental is still taxed). Up to 10 years of qualified official extended duty and up to two years of temporary absence for work, health or unforeseen circumstances are also not nonqualified use (26 U.S.C. 121(b)(5)). The rule mainly reaches a house that was a rental or second home before it became your main home.

Rates on gain above the exclusion

Long-term gain is taxed at 0%, 15% or 20% depending on taxable income. For taxable years beginning in 2026, Revenue Procedure 2025-32 sets the top of the 0% band and the top of the 15% band as follows.

Filing status (tax year 2026) 0% up to 15% up to (20% above)
Single $49,450 $545,500
Married filing jointly $98,900 $613,700
Head of household $66,200 $579,600
Married filing separately $49,450 $306,850

These bands apply to taxable income, which includes the taxable part of the gain. Higher-income sellers may also owe the 3.8% net investment income tax on gain that is not excluded. IRS Topic no. 559 sets the thresholds on modified adjusted gross income at $200,000 for single filers and $250,000 for joint filers, and says the excluded part of a main-home gain is not subject to it. This article does not cover state income tax, which varies by state.

Reporting the sale to the IRS

You have to report the sale if you received a Form 1099-S, if you have taxable gain that is not fully excluded, or if you choose to report a gain you could exclude. In those cases, you use Form 8949 and then Schedule D (Form 1040), according to Topic no. 701 and Publication 523. Receiving a 1099-S means the sale is reported on Form 8949 even if you have no taxable gain.

The 1099-S is filed by the person responsible for closing, usually the settlement agent, and it shows the closing date and the gross proceeds, which are generally the sale price. The Form 1099-S instructions let that person skip the form for a principal residence sold for $250,000 or less ($500,000 if the seller is married) if each seller signs a written certification under penalties of perjury that the home is a principal residence, that the full gain is excludable and that there was no nonqualified use after 2008. The certification is optional for the filer, so a sale below those prices can still produce a 1099-S. What the form shows is the gross proceeds, not your gain; the gain is what you calculate with your basis.

Frequently asked questions

Do I pay capital gains tax if I sell my house for less than I paid?

Usually not, but compare the amount realized with your adjusted basis, not with the price you paid. Depreciation claimed for a home office or rental lowers basis, so a sale below the purchase price can still produce a gain equal to some or all of that depreciation, and that part is taxable. If there is a real loss, it is not deductible on a main home. If you received a Form 1099-S, the sale is still reported on Form 8949 (Publication 523).

Can I use the exclusion more than once?

Yes, but you generally cannot use it on a sale if you excluded gain on another home sold within the two years before. Each sale has to meet the ownership and use tests on its own (Topic no. 701).

Do I owe tax if I moved out and rented the house first?

You can still qualify if you owned the home and lived in it at least 24 months in the five years before the sale, which means selling no more than three years after moving out. Rental time after you moved out, within that window, is not nonqualified use, so it does not reduce the exclusion. Any depreciation claimed on the rental after May 6, 1997 cannot be excluded (Publication 523).

What counts as an improvement when I work out my basis?

Capital improvements, such as an addition or new roof, add to basis, as do certain closing costs. Routine repairs and maintenance do not count, so keep receipts and records for the work that qualifies (Publication 523).

What do spouses need for the full $500,000?

You file jointly, at least one spouse meets the ownership test, both spouses meet the use test, and neither spouse excluded gain on another home sold in the two years before. A surviving spouse who has not remarried can count the late spouse’s ownership and residence time and may use $500,000 if the sale is within two years of the death (Publication 523).

Steps before you sign the sale

  1. Count 24 months of ownership and 24 months of residence in the five years before the closing date, for each spouse if filing jointly, and check whether you excluded gain on another sale in the last two years.
  2. Gather your purchase closing statement, improvement receipts and the sale closing statement, and subtract selling expenses to compute the gain.
  3. Note any year in which you claimed depreciation or a home office deduction.
  4. If you think the sale qualifies for the certification, ask the settlement agent whether a 1099-S will be filed; if one arrives, plan on Form 8949 and Schedule D.
  5. If the gain is above your exclusion, estimate the tax using the 2026 rate bands above, and consider whether the net investment income tax applies.

This article is general education about federal tax rules, not tax advice for any one sale; a licensed tax professional can apply these rules to specific facts.

Sources

Was this article helpful?

Your feedback helps us improve our editorial quality

Latest Articles

Taxes 10.11.2026

What to Do If You Can't Pay Your Tax Bill on Time

File on time even if you can't pay: the late-filing penalty is ten times the late-payment penalty. If you cannot pay your tax bill on time, the IRS offers payment plans that cost less than ignoring the debt, and this article lays out the steps in order. It covers the failure-to-file and failure-to-pay penalty rates, the 7% interest rate in the fourth quarter of 2026, short-term plans and long-term installment agreements with their current setup fees, and when an offer in compromise or currently-not-collectible status is worth a look. A computed example for a $5,000 balance shows what 12 months costs when nothing is paid, when the same monthly payments are made with and without a plan, and when no return is filed. A final section explains penalty relief, including the IRS's new automatic exemption.

Read » 456
Taxes 10.11.2026

What Income Is Taxable and What Is Not

Wages, gifts, Social Security, settlements and debt relief sorted into taxable, not taxable and it depends. This reference sorts the common kinds of money a US household receives by how the IRS treats them, using Publication 525 and the related IRS pages. Each row states the condition that changes the answer: the Social Security base amounts, physical injury versus other settlements, room and board in a scholarship, the 14-day rental rule, pre-2019 versus later alimony, and insolvency for canceled debt. It also covers the new 2025 to 2028 deductions for tips and overtime and who qualifies for them, the 2026 gift tax exclusion, and the 2026 change to gambling loss deductions, with short illustrative examples worked out in dollars that you can adapt to your own numbers.

Read » 494
Taxes 26.11.2026

Do You Owe Capital Gains Tax When You Sell Your Home?

Most home sellers owe no tax up to $250,000 of gain, or $500,000 for joint filers, if two tests are met. The rule for capital gains on a home sale depends on how long you owned and lived in the house, what you paid for it and improved it, and whether part of it was ever depreciated. This piece walks through the two-year ownership and use tests, the partial exclusion for job, health and unforeseen moves, a worked gain calculation with illustrative numbers, depreciation recapture for a home office or rental use, and when a sale has to be reported on Form 8949 and Schedule D even though no tax is due. It also lists the 2026 long-term rate thresholds for any gain above the exclusion.

Read » 120
Taxes 10.11.2026

How to Adjust Your Tax Withholding the Right Way

A new Form W-4 and the IRS estimator can fix withholding in minutes. Withholding is the federal income tax your employer takes from each paycheck, and it is set by the Form W-4 you give payroll. This article walks through the 2026 form step by step, shows how to turn an expected shortfall into a dollar amount per paycheck with a worked example, explains when to recheck (new job, marriage, a child, new tips or overtime deductions), and lays out how the underpayment penalty really works: interest-based, with a 90% current-year, 100% or 110% prior-year safe harbor and a $1,000 cutoff, plus a sample penalty figured at the 2026 IRS rates. It also covers two-job households, why state withholding needs its own form, and a short checklist to run before you hand the form to your employer.

Read » 442
Taxes 09.11.2026

Marginal vs Effective Tax Rate: Why Both Matter

A 22% bracket does not mean 22% of your pay: $90,000 in wages works out to 12.2% federal income tax. Your marginal tax rate is the rate on the next dollar of taxable income, and your effective tax rate is total tax divided by income. This article uses the 2026 federal brackets to work out both rates for three illustrative incomes, single and married filing jointly, and shows why a raise cannot lower take-home pay through the brackets alone. It also covers the exception worth knowing, phase-outs that make the next dollar cost more than the bracket suggests, using the 2025-law senior deduction as a verified example, and explains where payroll and state taxes fit outside the federal brackets.

Read » 578
Taxes 10.11.2026

Why a Big Refund Is Not Always Good News

A big refund can mean the IRS held your paycheck money all year without interest, but credits change the math. When a large refund comes from over-withholding, it is your own paycheck money coming back once a year, usually with no interest, so the real question is what you could have done with it sooner. This article puts numbers on that wait using the FDIC national savings rate, gives the latest IRS filing-season average refund for 2026, explains why refundable credits like the EITC and the Additional Child Tax Credit are a different case, and lists the situations where overpaying is a deliberate and reasonable choice. It also covers the underpayment penalty, so you can see the risk on the other side before changing anything.

Read » 617