Tax Advantages When Selling a Home

December 10, 2022  | By David Lowe

What if you knew that up to $500,000 of gain on an asset would be tax-free? Would you consider investing in that asset?

Chances are, you already own such an investment. More specifically, you live in it.

As tax expert Jeff Socha noted in this podcast, the United States tax code offers several incentives for real estate ownership. One of those incentives is that the seller may exclude from federal taxation a certain amount of gain on the sale of a primary residence.

Single tax filers who have owned and lived in their primary residence at least two of the last five years may avoid taxation on up to $250,000 of gain when selling their house. If married filing jointly, up to $500,000 of gain is tax-free.

That can be a huge advantage, particularly when a home’s value has increased significantly over the years. Those who have resided in the same place for many years – or who live in areas with rapid home price appreciation – might sell their house for hundreds of thousands of dollars more than the original purchase price.

Tax Savings

With many investments, a six-figure gain would mean a hefty tax bill. If the investment is a qualifying primary residence, however, the tax bill could be much less – or even zero.

The long-term capital gains tax rate – which depends on a person’s taxable income – is 15% for many Americans. For those with very high incomes, the rate is 20%. Here are the capital gains brackets for the 2022 and 2023 tax years. (For simplicity’s sake, this post will focus only on the rates for single and married filing jointly taxpayers.)


  • 0% bracket
    • Single = $0-$41,675 of taxable income
    • Married filing jointly = $0-$83,350
  • 15% bracket
    • Single = $41,676-$459,750 of taxable income
    • Married filing jointly = $83,351-$517,200
  • 20% bracket
    • Single = $459,751 or more of taxable income
    • Married Filing Jointly = $517,201 or more of taxable income


  • 0% bracket
    • Single = $0-$44,625 of taxable income
    • Married filing jointly = $0-$89,250
  • 15% bracket
    • Single = $44,626-$492,300 of taxable income
    • Married filing jointly = $89,251-$553,850
  • 20% bracket
    • Single = $492,301 or more of taxable income
    • Married Filing Jointly = $553,851 or more of taxable income

As a simple example of the savings offered by the home sale gain exclusion, consider some basic scenarios that only account for capital gains taxes.

Assume a single person earns a salary of $150,000 and recognizes $250,000 in long-term capital gains from the sale of stocks: The investor would owe $37,500 – or 15% of $250,000.

On the other hand, imagine the same person selling a primary residence after living in it for three years. The gain is $250,000 – identical to the stock gain in the preceding example – but there is no capital gain tax on the house. That’s $37,500 more in the investor’s pocket!

The savings can be even bigger for those in higher tax brackets. Say a hypothetical married couple earns $560,000 in total salaries and bonuses. The couple gains $500,000 by selling a house where they had lived for a decade. Because of the home sale gain exclusion, the tax bill would be zero.

On the other hand, had that couple – in the 20% capital gains tax bracket – gained $500,000 from the sale of stocks held long-term, the government would have kept $100,000.

Now, imagine that the high-income couple’s gains were a bit higher – say $600,000 from the sale of stock held for several years versus $600,000 from the sale of the couple’s long-time residence.

When selling the stock, the couple would owe $120,000 of capital gains tax (20% X $600,000).

But for the house, $500,000 of the gain would be excluded, leaving only $100,000 subject to taxation. A 20% levy would equal $20,000 – a tax bill $100,000 lower than if the gains had come from stocks. What a deal!

High-income taxpayers may owe not just capital gains taxes, but also the Net Investment Income Tax. This 3.8% tax applies to whichever is less:

  • the taxpayer’s net investment income, or
  • the amount by which Modified Adjusted Gross Income exceeds these thresholds:
    • $250,000 for married filing jointly or qualifying widower with dependent child
    • $125,000 for married filing separately
    • $200,000 for all other taxpayers
    • Note: unlike with some IRS limits, the preceding MAGI thresholds do not increase each year based on inflation. So, over time, more people are likely to be subject to the Net Investment Income Tax.

For detailed Net Investment Income tax calculations, please contact your CPA.

Determining basis

For projecting how much tax you may owe on the sale of your residence, it is essential to know your “basis.” This tax term essentially means how much you invested into the asset. When the residence changes hands, the sale price minus seller’s expenses minus the basis equals the gain or loss on the transaction.

The higher the basis, the less likely it is that the gain on the home sale will exceed the $250,000 (single) or $500,000 (married filing jointly) exclusion. In other words, being able to demonstrate a higher basis makes it less likely that you will owe federal taxes on the sale of your residence.

The purchase price is the most obvious number to include when calculating the basis in a house. The IRS also allows several acquisition-related costs to count toward the basis. (For details about basis calculations, see p. 8 of this IRS publication.) Qualifying expenses include:

  • Buyer’s closing costs such as:
    • Abstract fees
    • Survey fees
    • Recording fees
    • Title insurance
  • Costs related to new builds. These include:
    • Land
    • Labor and materials
    • Contractor charges
    • Architect’s fees
    • Building permits
    • Legal fees directly connected to the house construction
    • Charges for utility meters and connections

The basis increases further if the owner makes improvements and additions such as:

  • Bathroom remodels
  • Bedroom additions
  • New floors
  • Landscaping
  • Swimming pools
  • New pipes and ductwork
  • Installation of an air or water filtration system

For home improvements, it is important to retain receipts, contractors’ invoices or other documentation. Those will prove very helpful at tax filing time.

Repairs and maintenance are important to keep a house in good shape. However, if such work does not increase the house’s value or extend its life, the cost does not add to the basis. For example, re-painting a room, fixing a busted window or replacing a malfunctioning washing machine won’t increase your basis. Those repairs sure can make life more comfortable, though, so all is not lost!

Prorating the gain exclusion

Some benefits in life work on a use-it-or-lose it basis. Fortunately, the home sale gain exclusion is more flexible.

First, for married couples, only one spouse must own the property.

Second, although there is a 24-month residency requirement, the months do not have to be consecutive. The homeowner(s) simply must have lived in the house for a total of two years within the five years before the sale date.

In addition, a partial tax exclusion is available when the homeowner(s) do not meet the full 24-month residency requirement. A prorated exemption is available when the owner(s) move before the 24-month mark for any of the following reasons:

  • Employment change, if the new job is at least 50 miles farther from home than the old work site was. In other words, a move across town wouldn’t qualify, but a job-related move from Dallas to Houston – or from Northern California to Arizona – would.
  • Health. This includes:
    • Moving to obtain a diagnosis or care for oneself or a family member
    • Moving to provide personal care for a family member suffering from a disease, injury or illness
    • Changing residences because a doctor recommended it as a way to improve health. Think of migrating south for warmer weather or leaving a smoggy area to prevent asthma trouble.
  • Destruction or condemnation of the residence
  • Casualty loss due to natural or man-made disaster, including terrorism
  • The birth of twins, triplets or other multiples
  • The death of a co-owner of the residence
  • Other occurrences that the IRS classifies as “unforeseeable.” For more details, see page 6 of this IRS publication.

To envision how a prorated exclusion would work, imagine a single woman whose company transfers her across the country 18 months after she bought her personal residence. The homeowner would have met 75% of the 24-month residency requirement. As a result, the first $187,500 of gain from the house sale (75% of $250,000) would be tax-free.

For another prorating scenario, imagine a taxpayer buys and occupies a residence for eight years, then marries. One year into the marriage, one spouse is diagnosed with cancer. The couple moves across the country for regular care at a top-ranked oncology facility. The former house is in a strong real estate market, and the couple sells it for a $575,000 gain.

In effect, the $500,000 exclusion is divided between the two spouses. The one who lived in the house for a total of nine years can exclude $250,000 of gain. The other spouse – who made it halfway to the two-year mark – can exclude $125,000 of gain (half of $250,000). Therefore, the couple’s total exclusion is $375,000, and $200,000 of gain is taxable.

Other considerations

IRS Publication 523 states that the home sale gain exclusion applies to many different kinds of structures – as long as they are primary residences. That means this special tax benefit is valid for houses, condominiums, cooperative apartments, mobile homes and houseboats.

The IRS says to report the gain on the sale of a primary residence if the answer is “yes” to any of the following:

  • You don’t qualify to exclude all of the gain
  • You received Form 1099-S. In that case, report the sale on Form 8949 even if there is no taxable gain.
  • You want to report the gain as taxable, even if you don’t have to. Taxpayers may choose this option if they plan to sell another main home within the next two years – and expect to have a larger gain from that property than from the first house.

If you report on Form 8949, use that data to report the home gain or loss as a capital gain or loss on Schedule D (Form 1040). If a home sale results in taxable gain, you may need to increase your tax withholding or make estimated tax payments. See this IRS publication for more details.

Long-term capital gain taxes probably are not the main thoughts in most people’s minds when they buy a house. Buyers more likely focus on neighbors, schools, remodeling plans and the prospect of the many fond memories they will make in the home.

Nevertheless, even though a house means more than money, it still is an investment. And thanks to the home sale gain exclusion, it can be a very tax-efficient one!

David Lowe, CFP®
512-467-2000, ext. 111   |  [email protected]

David joined Austin Wealth Management in late 2021 as a financial planning associate. He has been interested in personal finance for years and holds the CERTIFIED FINANCIAL PLANNER™ designation. David’s interest in investing began in his teenage years through conversations with…Read More

Return to Blog Page