Capital Gains Tax Strategies for Selling Your Primary Home
Selling your house is a major financial event. If property values in your area have jumped, you might be looking at a massive profit. The good news is that the IRS offers a generous tax break that lets you legally keep up to half a million dollars of that real estate profit completely tax-free.
The Section 121 Exclusion Rule
The primary tool for avoiding taxes on your home sale is the Section 121 exclusion. This IRS rule allows married couples filing jointly to shield up to $500,000 of profit from capital gains taxes. Single filers can exclude up to $250,000.
To qualify for this massive tax break, you must pass two strict IRS tests:
- The Ownership Test: You must have owned the property for at least two of the five years immediately preceding the sale.
- The Use Test: You must have lived in the house as your primary residence for at least two of those five years.
The 24 months of residency do not have to be consecutive. You could live in the house for a year, rent it out for two years, and then move back in for another year to satisfy the requirement.
Calculating Your True Capital Gain
Your capital gain is not simply the sale price of your house minus the price you originally paid. The IRS allows you to use your “adjusted basis” to calculate your taxable profit. By correctly calculating your basis, you can lower your official profit and stay under the tax-free limits.
Your adjusted basis starts with your original purchase price. You then add the cost of any major capital improvements you made over the years. Finally, you subtract your selling expenses. Selling expenses include real estate agent commissions, escrow fees, legal fees, and home staging costs.
Consider this specific example. You are single and bought a house for $300,000. Over ten years, you spent $50,000 on a new roof and an upgraded kitchen. Your adjusted basis is now $350,000. You sell the house for $650,000 and pay $40,000 in agent commissions and closing costs. Your net sale price is $610,000. When you subtract your $350,000 adjusted basis, your final capital gain is $260,000. Because you are single, you can exclude $250,000. You will only owe taxes on the remaining $10,000.
Maximizing Capital Improvements
Keeping track of capital improvements is the best strategy for lowering your tax bill. However, the IRS is very clear on the difference between an improvement and a repair.
A repair keeps your home in ordinary working condition. Fixing a leaky faucet, patching a hole in the drywall, or painting a bedroom are repairs. These do not add to your home’s basis.
An improvement adds permanent value to the property, adapts it to new uses, or prolongs its life. Eligible improvements include:
- Adding a new bedroom or bathroom
- Installing a new central air conditioning or heating system
- Replacing all the windows
- Paving a gravel driveway
- Putting on a new roof
You must keep your receipts, contractor invoices, and bank statements. If the IRS audits your home sale, you will need to prove exactly how much you spent on these upgrades.
Getting a Partial Exclusion
Sometimes life forces you to move before you hit the two-year mark. The IRS offers a partial exclusion if you must sell your home due to unforeseen circumstances.
If you get a new job that is at least 50 miles farther from your old home than your previous commute, you qualify for a partial break. Health issues that require a move to get medical care also count. Other valid reasons include divorce, natural disasters destroying your property, or giving birth to twins or triplets.
If you qualify for an unforeseen circumstance, your exclusion is prorated. For example, if you lived in the home for 12 months (exactly half of the required two years), you get half of the exclusion limit. A single filer could shield $125,000 of profit, and a married couple could shield $250,000.
What Happens If You Exceed the Limits?
If your profit is larger than the $250,000 or $500,000 limits, you will owe taxes on the overage. Because you owned the home for over a year, this profit is taxed at the long-term capital gains rate.
For the 2024 tax year, federal long-term capital gains rates are 0%, 15%, or 20% depending on your taxable income. Most middle-income earners will pay the 15% rate.
High earners must also watch out for the Net Investment Income Tax (NIIT). If your modified adjusted gross income is over $250,000 for married couples or $200,000 for single filers, the IRS applies an extra 3.8% tax on your investment gains. This includes the taxable portion of your real estate profit.
Special Rules for Military and Widows
The federal government provides special extensions for certain groups. Active duty military personnel, intelligence officers, and Foreign Service workers often have to relocate under official orders. If you fall into this category, you can suspend the five-year testing period for up to ten years. This gives you a 15-year window to meet the two-year residency requirement.
Surviving spouses also receive a distinct benefit. If your spouse passes away, you can still claim the full $500,000 joint exclusion as long as you sell the property within two years of your spouse’s death.
Frequently Asked Questions
Do I have to buy another house to avoid paying the capital gains tax? No. Decades ago, the IRS required you to roll your profits into a new, more expensive house to avoid taxes. That rule was eliminated in 1997. Today, you can take your tax-free profit and use it for anything you want.
How often can I use the Section 121 exclusion? You can use this primary home tax exclusion once every two years. If you buy houses, live in them for two years, and sell them for a profit, you can repeatedly shield your gains from federal taxes.
What if I rented out a room or had a home office? If you took depreciation deductions for a home office or for renting out a portion of your house, you cannot exclude that specific portion of the profit. You will have to pay a 25% depreciation recapture tax on the amount you previously deducted. You can still use the Section 121 exclusion on the residential portion of the home.