How to avoid capital gains taxes on real estate

Jun 20, 2025

7-minute read

Share:

Woman snuggling fluffy dog on couch.

Selling your home or investment property is a major financial milestone, and it’s one that should move you forward, not set you back. Without a clear understanding of capital gains taxes, your profit could decrease more than expected. The good news? With the right knowledge and planning, you can minimize your tax burden and make the most of your sale.

Key takeaways:

  • You may be able to exclude up to $250,000 – $500,000 in profits. If you’ve lived in your home for at least 2 of the past 5 years, you may qualify for the home sale exclusion, which allows single filers to exclude up to $250,000 and married couples up to $500,000 in capital gains from taxes.
  • Capital gains taxes depend on how long you owned the property. Selling after owning a property for more than 1 year qualifies you for lower long-term capital gains tax rates (0% – 20%), while selling before 1 year may result in higher short-term rates taxed like ordinary income.
  • Your tax rate is influenced by income, filing status, and property type. Factors like whether the property is a primary residence or investment, your annual income, and your filing status directly affect how much you’ll owe in capital gains taxes.

What are capital gains taxes?

When you sell a home or investment property for more than you paid for it, the profit you earn is considered a capital gain. That gain is taxable, meaning the IRS could take a sizable chunk out of your earnings, especially if you’re unaware of how the rules work.

Capital gains taxes can be costly. If you’ve owned the property for more than a year, you’ll likely pay long-term capital gains tax, which ranges from 0% to 20% depending on your income. If you've owned it for less than a year, your gain may be taxed at ordinary income rates, which could be significantly higher.

Ways to avoid capital gains taxes on real estate

Capital gains taxes can take a bite out of your home sale profits, but they don’t have to. With the right strategy, you may be able to reduce or even avoid them altogether. Understanding these legal options can help you keep more of your earnings and confidently take your next step, whether it’s into a new home or a new opportunity.

121 home sale exclusions

If you’re selling your primary residence, the IRS offers a major advantage through the Section 121 exclusion. This rule allows you to exclude up to $250,000 of profit from capital gains taxes if you’re single, or up to $500,000 if you’re married and filing jointly, so long as you’ve owned and lived in the home for at least 2 of the past 5 years. This exclusion can make a significant difference in how much you walk away with after closing.

Eligibility 

To qualify for the capital gains exclusion, you must have owned and lived in the home as your primary residence for at least 2 of the 5 years before the sale. This doesn’t need to be continuous time, but it must add up to 24 months within that 5-year window.

Numerous types of homes are eligible for the home sale exclusion, including:

  • Mobile homes
  • Trailers
  • Houseboats
  • Condominiums
  • Single-family homes
  • Cooperative apartments

Limitations

If you meet the requirements, you can exclude up to $250,000 in capital gains if you file as single or married filing separately, and up to $500,000 if you file jointly with a spouse. This exclusion can only be used once every 2 years, so if you've already claimed it during that time, you'll need to wait before applying it to another sale.

Get approved to buy a home

Rocket Mortgage® lets you get to house hunting sooner

1031 like-kind exchange

For those selling an investment property, the 1031 like-kind exchange is another powerful tool. This tax-deferral strategy allows you to reinvest the proceeds from the sale of one investment property into another qualifying property, delaying capital gains taxes in the process. It’s a smart move for investors looking to grow their portfolios without triggering an immediate tax bill.

Eligibility

The property being sold must be held for investment or business purposes, not as a primary residence. To qualify for a 1031 like-kind exchange, you must:

  • Identify a replacement property within 45 days of selling the original property.
  • Close on the new property within 180 days of the original sale.
  • Use a Qualified Intermediary (QI) to hold and transfer the sale proceeds.
  • Purchase a replacement property of equal or greater value to fully defer taxes.

Limitations

  • The transaction must follow strict IRS rules, including timely identification and closing.
  • You must reinvest all proceeds; otherwise, the unused portion (called “boot”) may be taxed.
  • You must report the transaction to the IRS using Form 8824 during the tax year of the exchange.
  • Deferral is not permanent. Capital gains taxes will apply if you sell the new property later without another exchange.

Other ways to minimize capital gains taxes

When it comes to capital gains taxes, there’s more than one way to protect your profit. The IRS provides several opportunities for homeowners to reduce or defer their tax burden, if you know where to look.

By understanding and leveraging these strategies, whether you’re relocating, upgrading your home, or working in public service, you can make confident decisions that align with your financial goals and minimize your tax burden legally and effectively.

Live in the house for at least 2 years

One of the most effective ways to avoid capital gains taxes is by meeting the ownership and use test. If you live in your home for at least 2 out of the 5 years before selling, you may qualify for the Section 121 exclusion.

For example, if you bought your home for $300,000 and sold it for $600,000 after living in it for over 2 years, you could potentially exclude the entire $300,000 profit from your taxable income, assuming you meet the other requirements.

Determine if you qualify for exceptions

Even if you don’t meet the full 2-year requirement, you may still qualify for a partial exclusion under special circumstances. The IRS makes exceptions for taxpayers who need to sell their home due to unforeseen events, allowing you to exclude a prorated portion of your capital gains.

You have to sell because of a job or illness

  • If you’re forced to sell your home due to a job relocation, health condition, or other major life change, the IRS may let you exclude a portion of your capital gain, even if you didn’t live in the home for the full 2 years.
  • For instance, if you lived in the home for one year but have to relocate 75 miles away for a new job, you might be eligible to exclude half of the standard exclusion. Tax preparers and financial professionals can help you document and validate the reason for your move and ensure the IRS recognizes your exception. 

You work for the federal government

  • Some federal employees receive special consideration that extends the 5-year eligibility window for capital gains exclusions. Specifically, if you're serving on qualified official extended duty, you may suspend the 5-year test period for up to 10 years, giving you more time to qualify for the home sale exclusion.
  • Federal employees who qualify for this exception include:
    • Foreign service members
    • Intelligence community employees
    • Members of the uniformed services stationed away from home
  • This extension gives federal employees the flexibility to sell their homes without losing the chance to exclude their capital gains, even if they’ve been away for extended periods due to service.

Start your next home project today.

Discover your personal loan options with just a few clicks.

Write off improvements on the home

Another smart way to reduce your capital gains liability is by increasing your cost basis. Cost basis is the amount you originally invested in the home. Improvements you make to the property can be added to your cost basis, which reduces the size of your taxable gain when you sell.

Let’s say you purchased your home for $400,000 and later added a new roof, remodeled the kitchen, and upgraded the HVAC system, totaling $50,000. Your adjusted basis becomes $450,000. If you sell for $600,000, your capital gain is only $150,000 instead of $200,000.

FAQ

Still have questions about how capital gains taxes work when selling your home or investment property? You’re not alone. Below, we’ve answered some of the most common questions to help you navigate your next steps with clarity and confidence.

What is the $250,000/$500,000 capital gains tax exclusion?

The $250,000/$500,000 capital gains tax exclusion is an IRS provision that allows homeowners to exclude up to $250,000 of profit from the sale of their primary residence if they file as single, or up to $500,000 if they’re married filing jointly. To qualify, you must have owned and lived in the home for at least 2 of the 5 years before the sale. This exclusion can be used once every 2 years and helps reduce or eliminate capital gains taxes on qualifying home sales.

Do I pay capital gains taxes if I inherit a property?

Generally, you don’t pay capital gains taxes at the time you inherit a property. However, if you later sell the inherited property, you may owe capital gains taxes on the profit. It’s calculated using a “stepped-up basis,” which adjusts the property’s value to its fair market value at the time of the original owner’s death. This often reduces or eliminates the taxable gain when the property is sold soon after inheritance.

Are there capital gains taxes if I sell a house after divorce?

Yes, capital gains taxes may apply if you sell a house after a divorce, but there are important rules that can reduce or eliminate the tax burden. If the home was your primary residence and you meet the ownership and use requirements, you may still qualify for the $250,000 exclusion as a single filer, even if the home was previously owned jointly. Additionally, if the property was transferred to you as part of the divorce settlement, the IRS generally does not consider it a taxable event at the time of transfer, but capital gains may apply when the property is eventually sold.

Take the first step toward the right mortgage

Apply online for expert recommendations with real interest rates and payments

The bottom line: Capital gains taxes can be avoided or minimized

Selling a home or investment property can be a rewarding milestone. But without a clear understanding of capital gains taxes, it can also become an unexpected financial burden. As you plan your next move, it’s important to weigh all your options.

If you’re an investor looking to grow your portfolio, refinancing may offer the liquidity you need to reinvest and take advantage of new opportunities. Contact one of our representatives to discuss refinancing today.

If you're a homeowner not quite ready to sell, consider applying for a home equity loan to fund upgrades or renovations that can boost your property’s value and improve your quality of life.

No matter your path forward, taking the time to understand your capital gains exposure and exploring tax-smart strategies can help you protect your profit, plan your future, and make your next real estate move with confidence.

Portrait photo of Michelle Banaszak.

Michelle Banaszak

Michelle graduated from Michigan State University in 2011 with a Bachelor's in Communications and a Bachelor's in Studio Art. She's been writing for various companies since she graduated, and enjoys bringing stories and information to life. She currently works for Blue Cross Blue Shield of Michigan as a Communication Specialist and is a recent first-time homeowner.