7 Capital Gains Tax Rules for a Home Sale

Last Updated: November 10, 2026
Quick Summary
The capital gains tax on a home sale is usually zero, because you can exclude up to $250,000 of gain as a single filer or $500,000 if married filing jointly on a primary residence. Only gain above those amounts is taxable, at long-term capital gains rates.
- You must have owned and lived in the home for at least two of the five years ending on the sale date.
- Selling expenses and documented capital improvements reduce your gain dollar for dollar.
- There is no one-time exemption; the exclusion can be used again after two years.
- Buying a replacement home does not shelter gain; only the exclusion amount matters.
- Heirs generally receive a stepped-up basis equal to fair market value on the date of death.
Table of Contents
- How the Home-Sale Capital Gains Exclusion Works
- The Two-out-of-Five-Year Ownership and Use Tests
- Calculating Gain: Adjusted Basis, Improvements, and Selling Costs
- What Can Be Deducted From Capital Gains When Selling a House
- Using a Capital Gains Tax on Home Sale Calculator
- Is There a One-Time Capital Gains Exemption for Home Sale?
- Do I Have to Pay Capital Gains if I Sell My House and Buy Another?
- When a Home Sale Gain Is Taxable: Special Cases and Documentation
- Frequently Asked Questions
How the Home-Sale Capital Gains Exclusion Works
Most home sellers owe nothing on their profit. The capital gains tax on home sale rules allow you to exclude up to $250,000 of gain, or $500,000 for a married couple filing jointly, when you sell your primary residence (Topic no. 701, Sale of your home).
The home-sale exclusion is a federal provision that lets a qualifying homeowner permanently remove gain from a primary residence sale from taxable income. It is not a deferral and not a loan. The excluded amount never appears on your tax return as income.
The rules come from IRS Publication 523, Selling Your Home, which sets out eligibility, the ownership and use tests, and what counts as a selling expense.
The $250,000 Exclusion for Eligible Individual Filers
A single filer who meets the ownership and use tests can exclude up to $250,000 of gain. That figure applies per person, not per property, and is applied sale by sale rather than as a one-time allowance.
If your gain lands under the threshold, the sale produces no federal capital gains tax. Above it, only the excess is taxable, at long-term capital gains rates rather than ordinary income rates.
The $500,000 Exclusion for Married Couples Filing Jointly
Married couples filing jointly can exclude up to $500,000, but the higher figure carries extra conditions: both spouses must meet the use test, and at least one must meet the ownership test.
Watch out: a couple who marries and sells within the same year can trip the joint-filing requirement if one spouse used the exclusion on another home within the prior two years.
The Two-out-of-Five-Year Ownership and Use Tests
The two-out-of-five-year rule requires that you owned the home and used it as your main home for at least two of the five years ending on the sale date. The two years need not be consecutive, and short absences such as a vacation or temporary job posting generally do not break the use test.
Ownership and use are separate tests, and both must be satisfied. Holding title for decades does not satisfy the use test, a landlord who never lived in the property fails it no matter how long the deed carried their name.
IRS Topic No. 701, Sale of Your Home confirms that the five-year window is measured backward from the closing date, so a sale in March looks back to March five years earlier.
A Practical Eligibility Decision Tree
Work through these questions in order. A "no" at any step means you likely fail the standard exclusion and should look at the partial-exclusion rules below.
- Did you own the home for at least two of the five years ending on the sale date? Count backward from closing. The two years can be nonconsecutive, but the ownership interest must be yours (or your spouse's, for joint filers).
- Did you live in it as your main home for at least two of those same five years? Main home means your primary residence, not a rental, vacation property, or second home. Keep evidence such as driver's license, voter registration, utility bills, and tax returns showing the address.
- Have you excluded gain on another home sale within the two years before this sale? If yes, the standard exclusion is unavailable unless an exception applies.
- Are you filing jointly, and does at least one spouse meet ownership while both meet use? For the $500,000 amount, both spouses must meet the use test and at least one must meet the ownership test.
- Is the property your primary residence rather than business or rental property? Partial business use changes the math; see the special-cases section.
How the Five-Year Window Is Counted
The five-year period ends on the date of sale, generally the closing date when title transfers. Within that window you need 24 months of ownership and 24 months of use, and the months can be scattered.
Watch out: a temporary absence can break the use test if it lasts too long or if you rented the home during it. Short absences for vacation or a job posting generally do not count against you, but a multi-year rental period usually does.
When the Tests Fail but an Exception May Apply
If you fail the ownership or use test because of a change in employment, health reasons, or certain unforeseen events, you may qualify for a reduced exclusion, generally the full $250,000 or $500,000 multiplied by the fraction of the two-year period you met the tests.
These determinations are fact-specific. Confirm your position with a tax professional before relying on a reduced exclusion, and keep records showing the dates you occupied the home and the circumstances of the sale.
Calculating Gain: Adjusted Basis, Improvements, and Selling Costs
Your taxable gain is not the difference between what you paid and what you sold for. It is the sale price minus selling expenses, minus your adjusted basis, and adjusted basis is where most sellers leave money on the table.

Start with your cost basis: the purchase price plus certain closing costs you paid at acquisition, such as title fees and recording charges.
Then subtract selling expenses from the sale proceeds: real estate commission, title insurance, transfer taxes, attorney fees, and advertising costs.
A Worked End-to-End Gain Calculation
Here is how the arithmetic runs for a married couple selling a home they have owned and lived in for eleven years.
| Line | Item | Amount |
|---|---|---|
| A | Selling price | $640,000 |
| B | Selling expenses (commission, title, transfer tax) | $42,000 |
| C | Amount realized (A minus B) | $598,000 |
| D | Original purchase price | $310,000 |
| E | Capital improvements (roof, kitchen, HVAC) | $58,000 |
| F | Adjusted basis (D plus E) | $368,000 |
| G | Realized gain (C minus F) | $230,000 |
| H | Exclusion available (joint filers) | $500,000 |
| I | Taxable gain (G minus H, floored at zero) | $0 |
Amount
The couple owes no federal capital gains tax on this sale; their $230,000 realized gain sits entirely inside the exclusion.
If you are preparing for a sale and want to understand how the valuation side works, our guide on how to prepare your home for appraisal covers the steps that affect the number your buyer's lender relies on.
What Can Be Deducted From Capital Gains When Selling a House
Selling expenses reduce your gain dollar for dollar, and the list is longer than most sellers expect: real estate commission, title insurance, escrow and settlement fees, transfer taxes, attorney fees, and the cost of advertising the property.
Improvement records matter just as much. Every receipt for a capital improvement raises your adjusted basis and lowers taxable gain.
Two related guides help sellers assemble the full picture: our breakdown of who pays title insurance at closing, and our closing cost checklist for sellers, which lists the expenses that adjust your proceeds.
Using a Capital Gains Tax on Home Sale Calculator
A capital gains tax on home sale calculator is a worksheet that takes your selling price, selling expenses, adjusted basis, and filing status, then returns your realized gain and the portion above the exclusion.
A practical order of operations:
- Pull the original settlement statement from your purchase.
- Total your documented capital improvements by year.
- Add up estimated selling expenses from your listing agreement.
- Subtract expenses and basis from the sale price.
- Compare the result against $250,000 or $500,000 based on filing status.
Run the numbers before you list, not after closing. If the estimate shows gain above the exclusion, you have time to document improvements or adjust timing.
Is There a One-Time Capital Gains Exemption for Home Sale?
No. There is no one-time capital gains exemption for home sale in federal law, and the phrasing causes real confusion.
That two-year rule functions as a frequency limit rather than a lifetime cap.
Sellers who hear about a "one-time" exemption are usually thinking of the old rollover provision, which allowed deferral when proceeds went into a replacement home. That rule was replaced decades ago.
Do I Have to Pay Capital Gains if I Sell My House and Buy Another?
Generally no, and the reason is not a rollover. Since the exclusion replaced the old deferral rules, the purchase of a replacement home is irrelevant to whether your gain is taxed.
That distinction trips up sellers who assume buying a more expensive home shelters the profit. It does not.
If you are weighing a move and financing a new purchase, our mortgage lender resource explains how lenders assess your next loan while a sale is in progress.
When a Home Sale Gain Is Taxable: Special Cases and Documentation
Gain becomes taxable when it exceeds your exclusion, when you fail the ownership or use test without a qualifying exception, or when the property was never your primary residence.
Partial exclusions exist for specific circumstances, including a change in employment, health reasons, or certain unforeseen events, and the reduced amount is generally calculated in proportion to the time you met the tests.
Edge Scenarios That Change the Answer
- Divorce. A spouse who receives the home in a divorce settlement may be able to count the former spouse's ownership and use periods toward the two-out-of-five-year test, depending on how the transfer is structured. The transferring spouse's exclusion use can also affect the receiving spouse's eligibility.
- Death and inheritance. Heirs generally receive a stepped-up basis equal to the fair market value on the date of death, which often eliminates most of the gain. The exclusion rules for a surviving spouse selling a jointly owned home can be more favorable than the standard tests suggest.
- Military service. Qualified military members on extended active duty may suspend the five-year test period under specific rules, allowing them to meet the ownership and use tests after returning.
Documentation Checklist for a Home Sale
Keep these records for as long as the IRS can assess the return covering the sale.
- Purchase records: original settlement statement, deed, title insurance policy, and closing costs you paid at acquisition.
- Improvement records: contractor invoices, receipts, permits, and before-and-after photos for capital improvements such as a roof, kitchen remodel, HVAC replacement, or added bathroom.
- Sale records: listing agreement, closing statement, Form 1099-S if issued, and receipts for selling expenses such as commission, title insurance, transfer taxes, and attorney fees.
Watch out: discarding contractor invoices after a renovation is the most common documentation failure.
If a taxable sale is ahead of you, our seller services show how we prepare a listing and negotiate a sale with the tax picture in view from the start.
Frequently Asked Questions
How much capital gains tax will I pay on the sale of my home?
If you meet the ownership and use tests, you can exclude up to $250,000 of gain as a single filer or $500,000 as a married couple filing jointly. Any gain above the exclusion is taxed as a long-term capital gain, depending on your taxable income. A capital gains tax on home sale calculator can help you estimate the taxable portion before you list.
Do I have to buy another house to avoid capital gains?
No. The old rule that required you to reinvest in a replacement home has been replaced. Today, the home-sale exclusion depends on meeting the two-out-of-five-year ownership and use tests, not on buying another property. You can sell, take the exclusion, and rent or buy elsewhere without triggering tax on the excluded gain.
What can I deduct from capital gains when selling a house?
You can add qualifying capital improvements to your cost basis, which lowers your taxable gain. Examples include a new roof, a remodeled kitchen, or a replaced HVAC system. You can also subtract selling expenses such as real estate commissions, title fees, and advertising costs from the sale proceeds. Keep receipts for every improvement and settlement statement for the sale.
Is there a one-time capital gains exemption for home sale?
There is no one-time-only exemption. The $250,000 or $500,000 home-sale exclusion can be used every time you sell a primary residence, as long as you meet the ownership and use tests for that home. If you used the exclusion on a previous home, the two-year frequency limit may apply before using it again on another primary residence.
Categories
Recent Posts









GET MORE INFORMATION


