Homexa®

Do I Have to Pay Capital Gains Tax When I Sell My House?

The IRS lets most homeowners exclude up to $250,000 (or $500,000 married) of profit on a primary residence sale, tax free. Here is exactly how that works.

Most homeowners pay nothing. The IRS lets you exclude up to $250,000 of profit ($500,000 if married filing jointly) from the sale of a primary residence, as long as you owned and lived in it for at least two of the last five years. Gains above that amount, or on a second home, are usually taxable.

The two-out-of-five-year rule

To qualify for the exclusion, you need to have owned the home and used it as your primary residence for at least 24 months out of the 60 months before the sale date. Those 24 months do not have to be consecutive, and they do not have to be the two years immediately before closing. If you meet this test and your profit falls under the exclusion limit, you generally do not even need to report the sale on your tax return.

How your gain is actually calculated

Your taxable gain is not simply sale price minus purchase price. It is your sale price, minus your original purchase price, minus what you paid in closing costs both times, minus the cost of qualifying capital improvements (a new roof, an addition, a major system replacement), minus selling costs like agent commission. That adjusted number, your cost basis subtracted from your net proceeds, is what actually gets compared to the $250,000 or $500,000 threshold.

When you might still owe something

You could owe capital gains tax if your profit exceeds the exclusion amount, if you have not lived in the home for two of the last five years (common after a recent move, an inherited property, or a rental you are converting to a sale), or if the property was a second home or investment property rather than your primary residence. In those cases, the rate depends on how long you owned it: gains on a home held more than a year are taxed at long-term capital gains rates, which land at 15 percent for most sellers, though some high earners pay 20 percent.

Partial exclusions and exceptions

Even if you do not meet the full two-year residency test, you may qualify for a partial exclusion if you sold because of a job change, a health issue, or an unforeseeable circumstance like divorce. The IRS prorates the exclusion based on how much of the two-year period you actually lived there, so a partial year still buys you a partial break.

Investment properties and second homes are different

The exclusion only applies to a primary residence, so a rental property, a vacation home, or land you have never lived in does not qualify, and the full gain is generally taxable at your applicable capital gains rate. Investors selling a rental property sometimes use a 1031 exchange to defer that tax by rolling proceeds into another investment property under strict IRS timelines, but that option is not available for a primary residence sale. See our full 1031 exchange guide for property sellers for the IRS deadlines and how the process works.

The Homexa position

A Homexa® agent will not give you tax advice, that is a job for a CPA or tax attorney, but your agent can build out your likely net proceeds before you list, using your estimated sale price, mortgage payoff, and closing costs, so you walk into a tax conversation with real numbers instead of guesses.

Bottom line

Most sellers of a primary residence pay zero capital gains tax because of the $250,000/$500,000 exclusion. The exceptions usually come down to home type, second home or rental, or how recently you moved in, not the sale itself. Talk to a tax professional if your numbers are anywhere close to the threshold, and keep records of any capital improvements, since they lower your taxable gain.

Frequently Asked Questions

Do I have to pay capital gains tax when I sell my house?

Most homeowners pay nothing. The IRS lets you exclude up to $250,000 of profit, or $500,000 if married filing jointly, from the sale of a primary residence if you owned and lived in it for at least two of the last five years. Gains above that amount, or on a second home, are usually taxable. Talk to a tax professional if your numbers are close to the threshold. Homexa® connects sellers with experienced local agents.

What is the two-out-of-five-year rule for home sales?

To qualify for the exclusion, you must have owned the home and used it as your primary residence for at least 24 months out of the 60 months before the sale. Those 24 months do not have to be consecutive or immediately before closing. If you meet the test and your profit is under the limit, you generally do not need to report the sale. Homexa® can connect you with an experienced local agent.

How is the taxable gain on a home sale calculated?

It is not simply sale price minus purchase price. Start with the sale price, then subtract the original purchase price, closing costs paid both times, qualifying capital improvements such as a new roof or an addition, and selling costs like agent commission. That adjusted gain is what gets compared to the $250,000 or $500,000 threshold. Homexa® helps sellers find experienced local agents.

What capital gains tax rate applies if I owe tax on my home sale?

Gains on a home held more than a year are taxed at long-term capital gains rates, which land at 15 percent for most sellers, though some high earners pay 20 percent. You could owe if your profit exceeds the exclusion, if you have not lived there two of the last five years, or if the property was a second home or investment property. Homexa® is a simple way to reach an experienced local agent.

Can I get a partial capital gains exclusion if I sell before two years?

If you do not meet the full two-year residency test, you may still qualify for a partial exclusion if you sold because of a job change, a health issue, or an unforeseeable circumstance like divorce. The IRS prorates the exclusion based on how much of the two-year period you actually lived there. Homexa® connects home sellers with experienced local agents in their area.