↑↓ to move ↵ to open Esc to close Browse all tools

Money guide

Home Sale Tax Exclusion: $250,000, $500,000, 2-Year Test

Most people who sell the house they live in owe no federal tax on the profit, because the tax code excludes the first $250,000 of gain, or $500,000 for a couple. The rules decide who qualifies and, just as important, how the gain is measured, which is where many sellers overstate what they owe. Here are the tests from IRS Topic 701 and Publication 523, the gain formula, the partial exclusion, and one sale worked through.

The exclusion

IRS Topic 701 lets you exclude up to $250,000 of gain from the sale of your main home from income, or up to $500,000 on a joint return, if you meet both tests: you or your spouse owned the home for at least 24 months of the five years before the sale, and you used it as your residence for at least 24 months of those five years. The two 24-month periods do not have to coincide or be continuous. Publication 523 adds the look-back: the exclusion may be taken only once in a two-year period, so a sale within two years of an earlier excluded sale does not qualify for the full amount.

The gain (Publication 523)
selling price − selling expenses = amount realized; amount realized − adjusted basis = gain or loss; taxable gain = gain − exclusion, if positive

How the gain is measured

The gain is not the sale price minus the purchase price. Publication 523 subtracts the costs directly associated with selling, such as the real estate commission and advertising, to reach the amount realized, and then subtracts the adjusted basis: the purchase price plus the cost of improvements that add value, prolong the home's useful life or adapt it to new uses, reduced by depreciation claimed for business or rental use and by certain energy credits and subsidies. Repairs and maintenance that keep the home in good condition without adding value or prolonging its life do not add to basis; Publication 523 names painting, fixing leaks, filling holes or cracks and replacing broken hardware.

StepAmount
Selling price$700,000
Selling expenses (6% commission)− $42,000
Amount realized$658,000
Purchase price$350,000
Improvements over the years+ $40,000
Adjusted basis$390,000
Gain$268,000
Taxable gain, single ($250,000 exclusion)$18,000
Taxable gain, married filing jointly ($500,000 exclusion)$0

The single seller's $18,000 is a long-term capital gain, stacked on other income and taxed at 0, 15 or 20 percent; for 2026 the 0 percent rate runs to $49,450 of taxable income single and $98,900 joint, and 15 percent to $545,500 and $613,700, per Rev. Proc. 2025-32. The capital gains tax calculator takes the taxable part and works the year's tax with and without it. The couple owes nothing.

Less than two years: the partial exclusion

Publication 523 allows a partial exclusion when the main reason for the sale was a change in workplace location, a health issue or an unforeseeable event, with examples that include a death, a divorce, a pregnancy with multiple children, a change in employment status and a change in unemployment compensation eligibility. The worksheet in Publication 523 scales the maximum: take the shortest qualifying period, divide by 24 months (or 730 days) and multiply by $250,000; on a joint return each spouse's result is added.

Months owned and lived in (shortest of the tests)Maximum exclusion, singleMaximum exclusion, joint
6$62,500$125,000
12$125,000$250,000
18$187,500$375,000
24$250,000$500,000

A reduced maximum is often still enough: a seller who moved for a job after a year and made $90,000 on the house excludes all of it under the $125,000 limit. A sale with none of the qualifying reasons, such as moving simply because you want to, gets no exclusion before 24 months.

Rentals, second homes, reporting

  • Nonqualified use. Periods after 2008 in which the property was not your main home are nonqualified use, and the gain allocated to them cannot be excluded; Publication 523 has a worksheet for the split.
  • Depreciation. Depreciation claimed while part of the home was an office or the whole home was rented reduces the basis and raises the gain.
  • Form 1099-S. If you received one, the date of sale is in box 1 and the gross proceeds in box 2; Publication 523's reporting section says when the sale belongs on the return, and a taxable gain goes through Form 8949 and Schedule D.
  • Losses. Publication 523: a loss on the sale of your main home cannot be deducted.

The next purchase is a separate question: the home affordability calculator turns the proceeds into a down payment and a price range, and closing costs explained covers what the seller's side of the settlement statement takes before the proceeds arrive. This guide follows IRS Topic 701 and Publication 523 for 2025 returns; state income tax on the gain is a separate matter.

Frequently asked questions

How much profit on a home sale is tax free?

Up to $250,000 of gain, or $500,000 on a joint return, under IRS Topic 701, if you owned the home and used it as your main home for at least 24 months of the five years before the sale and did not exclude gain on another home in the two years before. Gain above the exclusion is a long-term capital gain taxed at 0, 15 or 20 percent depending on taxable income.

How is the gain on a home sale calculated?

Publication 523: selling price minus selling expenses gives the amount realized; subtract the adjusted basis, which is what you paid plus the cost of improvements that add value or prolong the home's life, less any depreciation claimed and certain credits. A home bought for $350,000 with $40,000 of improvements and sold for $700,000 with a 6 percent commission has a gain of $268,000, not $350,000.

What if I lived there less than two years?

You may qualify for a partial exclusion if the main reason for the sale was a change in workplace location, a health issue or an unforeseeable event, which Publication 523 illustrates with a death, a divorce, a pregnancy with multiple children, a change in employment status or a change in unemployment compensation eligibility. The maximum exclusion is scaled to the share of the 24 months you met the tests, so 12 months gives up to $125,000 single.

Does the exclusion apply to a second home or a rental?

Only to your main home, and only for the time it was one. Publication 523 treats periods after 2008 in which the property was not your principal residence as nonqualified use, and the gain allocated to those periods cannot be excluded; depreciation claimed while the home was rented also reduces the basis. A vacation home that was never your main home gets no exclusion.

What if I sold at a loss?

Publication 523 is direct: if the adjusted basis is greater than the amount realized, you sold your home at a loss, you cannot deduct that loss, and you do not need to pay any tax on the money you received from the sale.

Sources

General information based on the sources above, not tax, legal or financial advice.