If you're planning to sell your home, it's worth understanding how federal tax rules can reduce what you owe, or even help you qualify for certain deductions and credits. The IRS outlines these rules in Publication 523, Selling Your Home (2024). Below is a straightforward overview of the main ways homeowners can save money at tax time.
1. Excluding Gain on the Sale of Your Home
Most homeowners don't pay federal tax on profits from selling their main home, as long as they meet the ownership and residence tests.
- You can exclude up to $250,000 of gain if single, or $500,000 if married filing jointly.
- To qualify, you must have owned and lived in the home for at least two of the past five years before selling.
- The home must be your principal residence (your main home, not a vacation or rental property).
- If you don't meet the full two-year rule, you may still get a partial exclusion for certain reasons, such as a job relocation, health issues, or unforeseen events (like divorce or disaster damage).
2. Improvements That Increase Your Cost Basis
Keep track of home improvements, things like a new roof, kitchen remodel, HVAC system, or energy-efficient windows.
These increase your adjusted cost basis, which can reduce the taxable gain on your sale.
Repairs that only maintain the home (painting, patching, fixing leaks) usually don't count, but permanent upgrades that add value do.
3. Energy-Efficient Home Credits
Under the Inflation Reduction Act, you may qualify for energy-related tax credits if you upgraded your home before selling.
Eligible improvements include:
- Solar panels or battery storage systems
- Energy-efficient doors, windows, and insulation
- Certified home energy audits
These fall under Sections 25C and 25D of the tax code and can be worth up to 30% of qualifying costs.
See IRS News Release 2024-137 for details.
4. Mortgage Debt Forgiveness
If a lender forgives or cancels mortgage debt on your main home, for example, after a short sale or foreclosure, that amount normally counts as income.
However, the IRS has extended the exclusion of forgiven mortgage debt through December 31, 2025.
To qualify, the debt must have been on your principal residence, and the agreement to forgive it must be in writing before 2026.
5. Opportunity Zone Investments
If you reinvest capital gains from your home sale into a Qualified Opportunity Fund (QOF) within 180 days, you may defer or even exclude those gains.
This applies mainly to investors who meet long-term holding requirements (generally 10 years).
Details appear in Form 8949 Instructions and Section 1400Z-2.
6. Other Potential Tax Breaks
- Adoption and childcare credits: If you're selling because of a move or family change, check whether you qualify for these credits in the year of sale.
- Health-related moves: A move primarily for medical care may qualify you for a partial home-sale exclusion.
- Casualty or disaster losses: If your home was damaged before sale, you might be able to adjust your basis or claim related deductions.
7. Records to Keep
Always keep records of:
- Purchase and sale documents (HUD-1 or Closing Disclosure)
- Receipts for improvements
- Energy-credit certifications or invoices
- Settlement statements showing real-estate taxes or commissions
The IRS recommends keeping these records for at least three years after filing the return for the year of sale.
If you plan to sell your home soon, review how gain exclusions, basis adjustments, and energy-efficiency credits apply to your situation.
Small details, like how long you lived in the house or which receipts you saved, can make a big difference in what you owe (or don't owe) next April.
Need help interpreting changing IRS rules or tracking deductions automatically? Margen uses AI to analyze your tax documents and apply the right exclusions and credits in real time, saving you hours of research and calculation.