A modern two-story luxury house at dusk, with a stone-and-dark-siding facade, lit windows, a grid of large driveway pavers and no for-sale sign. Illustrative stock image; not a Haute Real Estate Network agent, client or listing.
Photo Credit: Shutterstock. A modern luxury house at dusk, with no for-sale sign (illustrative).

When you sell your main home, federal tax law may let you exclude up to $250,000 of the gain from income, or up to $500,000 for a married couple filing jointly, if you meet IRS ownership and use tests. On a luxury home that has appreciated a lot, any gain above that amount is generally taxable. IRS Publication 523 says you qualify for the full exclusion if you owned the home and used it as your main home for at least 24 months of the 5 years before the sale, and you didn't exclude gain on another home sold in the 2 years before. Your gain is the selling price, minus selling expenses, minus your adjusted basis, which includes what you paid plus the cost of improvements. A loss on the sale of a main home can't be deducted.

At a glance

QuestionAnswerSource
Maximum exclusion$250,000; $500,000 if married filing jointlyIRS Pub. 523
Ownership testOwned the home at least 24 months in the 5 years before the salePub. 523, Eligibility Step 2
Residence testLived in it as your main home at least 24 months (730 days) in those 5 years; the months don't have to be in a rowPub. 523, Step 3
Look-backNo exclusion on another home sold during the 2 years before this salePub. 523, Step 4
Automatic disqualificationHome acquired in a 1031 exchange during the past 5 years; expatriate taxPub. 523, Step 1
Partial exclusionPossible after a work move, a health issue or an unforeseeable eventPub. 523
Loss on the saleCan't be deductedPub. 523, Worksheet 2
Must you report?Yes if any gain is taxable, if you get Form 1099-S, or if you choose to report the gainPub. 523, Reporting

Married couple vs. single seller

Single (or married filing separately)Married filing jointly
Maximum exclusion$250,000$500,000
Ownership testYou must meet itAt least one spouse must meet it
Residence testYou must meet itBoth spouses must meet it for the full $500,000
Look-backYouNeither spouse can have excluded gain on another home in the prior 2 years

Source: IRS Publication 523 (2025). If only one spouse meets the residence test, Pub. 523's worksheet figures a smaller maximum.

How to figure the gain

Pub. 523 uses a simple sequence:

Selling price − selling expenses = amount realized Amount realized − adjusted basis = gain or loss

  • Selling expenses are costs directly tied to the sale, such as sales commissions, advertising fees and legal fees.
  • Adjusted basis generally starts with what you paid, plus certain settlement and closing costs from the purchase, plus improvements. Improvements "add to the value of your home, prolong its useful life, or adapt it to new uses," such as additions, new systems or a new roof. Repairs that only maintain the home generally don't count. See IRS Pub. 551 for basis.
  • Subtract certain items from basis, such as depreciation if you rented or used part of the home for business, and some casualty-loss deductions or insurance payments.

The exclusion then applies to the gain. Gain above the exclusion is generally reported as a capital gain on Form 8949 and Schedule D.

Situations that change the math on a luxury home

  • Big appreciation. On a long-held luxury home, the gain can be far above $500,000. The exclusion doesn't scale with price, so documenting every improvement in your basis matters.
  • Rental or business use. Depreciation claimed after May 6, 1997 can't be excluded and is recaptured. A separate guest house or office outside the living area may need its own gain calculation. Periods of "nonqualified use" after 2008 can reduce the exclusion.
  • A home from a 1031 exchange. If you acquired the home in a like-kind exchange within the past 5 years, the exclusion doesn't apply to its sale.
  • Two homes. Only your main home qualifies. If you split time between, say, New York and Florida, Pub. 523 applies a "facts and circumstances" test: the most important factor is where you spend the most time, and others include the address on your tax returns, voter registration and driver's license, and whether the home is near where you work and bank.
  • Selling sooner than 2 years. A partial exclusion may be available after a change in workplace at least 50 miles farther away, a health-related move or an unforeseeable event.
  • Divorce or a spouse's death. Pub. 523 has special rules for homes transferred between spouses and for surviving spouses.

How to plan the sale: 7 steps

1. Confirm it's your main home and count your ownership and residence months over the last 5 years. 2. Check the look-back. Did you exclude gain on another home in the past 2 years? 3. Rebuild your basis. Pull the closing statement from your purchase and receipts for improvements. 4. Estimate selling expenses with your agent: commissions, marketing, legal and other sale costs. 5. Estimate the gain using Pub. 523's Worksheet 2, and compare it with your exclusion. 6. Flag special facts (rentals, home office, a 1031 history, a divorce or a recent move) for your tax adviser. 7. Plan the reporting. If you'll get a Form 1099-S or have taxable gain, plan to report the sale on Form 8949 and Schedule D.

Checklist before you list

  • [ ] Ownership dates (deed) and residence dates for each spouse
  • [ ] Purchase closing statement
  • [ ] Receipts and permits for improvements
  • [ ] Records of any depreciation, home office or rental use
  • [ ] Whether the home came from a 1031 exchange
  • [ ] Dates of any other home sale in the last 2 years
  • [ ] A conversation with a CPA or tax attorney before signing the listing agreement

Frequently asked questions

How much capital gains tax do you pay when you sell your house?

It depends on your gain and your situation. If you qualify, you can exclude up to $250,000 of gain, or $500,000 if married filing jointly. Gain above that is generally taxable as a capital gain and reported on Form 8949 and Schedule D. A tax adviser can estimate your actual tax.

What is the 2 out of 5 year rule for selling a home?

To get the full exclusion, you must have owned the home and lived in it as your main home for at least 24 months during the 5 years before the sale. The 24 months of residence can fall anywhere in that 5-year window and don't have to be continuous. A vacation or other short absence counts as time you lived there.

Do you have to report the sale of your home to the IRS?

You must report it if any of the gain is taxable, if you received a Form 1099-S, or if you choose to report the gain instead of excluding it. If none of those applies, IRS Publication 523 says you don't need to report the sale.

Can a married couple exclude $500,000 if only one spouse is on the title?

Possibly. For the full $500,000, you must file jointly, at least one spouse must meet the ownership test, and both spouses must meet the residence test. Neither spouse can have excluded gain on another home sale in the prior 2 years.

Do home improvements reduce capital gains on a house sale?

Yes, improvements add to your basis, which lowers your gain. Improvements are items that add value, prolong the home's life or adapt it to new uses, like an addition or a new roof. Routine repairs generally don't count, so keep receipts.

Talk with a local agent

Featured agents: Haute Real Estate Network members include Chris Sullivan, a Broker Associate with REMAX Alliance Group and a Certified Luxury Home Marketing Specialist on Marco Island and in Naples; Monica Antola, a Broker Associate and Luxury Property Advisor at Compass and founder of the Antola Coastal Group in coastal Los Angeles; and Richard Steinberg, who leads The Richard Steinberg Team across New York City, the Hamptons, South Florida and Aspen. For tax decisions, talk to a CPA or tax attorney. Browse Find a Realtor.

Related pages

Sources

  • Internal Revenue Service, Publication 523, "Selling Your Home" (for use in preparing 2025 returns). https://www.irs.gov/publications/p523 (checked Nov. 25, 2026)
  • Internal Revenue Service, Publication 523 (PDF). https://www.irs.gov/pub/irs-pdf/p523.pdf (checked Nov. 25, 2026)

This article is editorial and informational only, not tax, legal or brokerage advice, and it doesn't guarantee any tax result. Tax rules can change and depend on your facts; confirm with a CPA or tax attorney and the current IRS Publication 523.