Most homeowners pay no federal tax when they sell their main home, thanks to a large exclusion. It is $250,000 of gain, or $500,000 for a married couple filing jointly, if you meet the ownership and use tests.
This guide explains the tests, how to figure the gain, when you owe tax, the partial exclusion and special cases, and how to report the sale, with worked examples from IRS Topic 701, Publication 523 and Topic 409.
The IRS says that if you have a capital gain from the sale of your main home, you may qualify to exclude up to $250,000 of it from income, or up to $500,000 if you file a joint return with your spouse. To qualify you must meet both the ownership test and the use test. You meet the ownership test if you or your spouse owned the home for at least 24 months (2 years) out of the last 5 years before the sale, and the use test if you and your spouse used it as a residence for at least 24 months of the previous 5 years.
On a joint return, either spouse can meet the ownership test but both must meet the use test individually. The two 2-year periods need not be the same, but both tests must be met within the 5-year period ending on the sale date. Generally you cannot use the exclusion if you excluded the gain from another home sold in the two years before this sale. The exclusion applies only to your main home, meaning your principal residence.
Publication 523 says to subtract selling expenses from the selling price to get the amount realized, then subtract your adjusted basis; a positive number is a gain and a negative number is a loss. Events during your ownership, such as using the home for business or making improvements, can affect your gain or loss. If you sold at a loss you cannot deduct it, but you do not owe tax on the sale proceeds. If your home was transferred to a spouse or ex-spouse in a divorce settlement, you are generally considered to have no gain or loss.
| Sale | Gain or loss | Taxable after exclusion (single, $250,000) | Taxable after exclusion (joint, $500,000) |
|---|---|---|---|
| Price $700,000, selling expenses $42,000, adjusted basis $300,000 | $358,000 | $108,000 | $0 |
| Price $600,000, selling expenses $36,000, adjusted basis $450,000 | $114,000 | $0 | $0 |
| Price $400,000, selling expenses $24,000, adjusted basis $450,000 | Loss of $74,000 | Not deductible | Not deductible |
These are our illustrations and assume the ownership and use tests are met. If the $108,000 taxable gain in the first example were taxed at 15%, the federal tax would be $16,200, but the rate depends on your total taxable income; see below.
Net capital gains are taxed at different rates depending on taxable income. For taxable years beginning in 2025 the IRS says the rate on most net capital gain is no higher than 15% for most individuals, with 0% at taxable income up to $48,350 (single and married filing separately), $96,700 (married filing jointly and qualifying surviving spouse) or $64,750 (head of household), and 20% to the extent income exceeds the 15% thresholds. Those are the 2025 figures in Topic 409. For taxable years beginning in 2026, Revenue Procedure 2025-32 sets the 0% rate at taxable income up to $49,450 (single and married filing separately), $98,900 (married filing jointly and surviving spouse) or $66,200 (head of household), and the 15% rate up to $545,500 (single), $306,850 (married filing separately), $613,700 (married filing jointly and surviving spouse) or $579,600 (head of household); above those amounts the 20% rate applies. IRS Topic 409 also says net short-term capital gains (assets held one year or less) are taxed as ordinary income, and the portion of any unrecaptured section 1250 gain from real property is taxed at a maximum 25%. For more on the brackets see our capital gains on real estate guide and capital gains brackets guide.
You may qualify for a partial exclusion, less than the full amount, if you meet one of the situations in Publication 523, which include a work-related move, a health-related move, a death, a divorce, a pregnancy with multiple children, a change in employment status, a change in unemployment compensation eligibility or another unusual event. Members of the Uniformed Services, the Foreign Service, the intelligence community and (under Publication 523) Peace Corps employees and volunteers who are on qualified official extended duty may elect to suspend the five-year test period for up to 10 years. If you sell under an installment contract, the exclusion remains available. Publication 523 says you cannot exclude the part of the gain equal to depreciation allowed or allowable after May 6, 1997, so depreciation from a home office or rental use can change the result; see our depreciation recapture guide.
If you receive Form 1099-S you must report the sale even if the gain is excludable, and you must also report it if you cannot exclude all of the gain. Use Schedule D and Form 8949 when required. See our Schedule D guide and Form 8949 guide. If you sold a rental or investment property rather than your main home, use our real estate guide instead.
IRS Topic 701: Sale of your home, IRS: Publication 523, Selling Your Home, IRS Topic 409: Capital gains and losses.