IRS Publication 523 – Selling Your Home – Selling your home is one of the biggest financial decisions you’ll make. Understanding the tax implications can save you thousands—or even tens of thousands—of dollars. IRS Publication 523, “Selling Your Home” (2024 edition) is the official IRS guide that explains exactly how the IRS treats home sales, including the powerful Section 121 capital gains exclusion.
Whether you’re a first-time seller, downsizing, or relocating, this article breaks down everything from IRS Publication 523 in plain English. We’ll cover eligibility for the exclusion, calculating your gain, special situations, reporting requirements, and more—using the latest official information as of 2025.
Download the full PDF here: IRS Publication 523 (2024)
What Is IRS Publication 523?
Published by the Internal Revenue Service, Publication 523 provides clear rules for taxpayers who sell or “otherwise dispose of” their main home. It details:
- How to qualify for the home sale gain exclusion.
- How to calculate your adjusted basis and taxable gain.
- Special rules for military members, divorced couples, inherited homes, and more.
- Worksheets to determine what you owe (or don’t owe) the IRS.
The 2024 edition (updated February 2025) applies to home sales in 2024 and beyond, with minor updates on energy credits and mortgage debt forgiveness.
Key takeaway: If you meet the tests, you can exclude up to $250,000 (single) or $500,000 (married filing jointly) of profit from taxes—tax-free.
The Big Benefit: Section 121 Home Sale Exclusion
Under IRC Section 121, most homeowners avoid capital gains tax on a large chunk of their home sale profit.
Maximum exclusion amounts:
- $250,000 if single, head of household, or married filing separately.
- $500,000 if married filing jointly.
This exclusion applies to your principal residence—the home you live in most of the time (fact-and-circumstances test: time spent, voting address, etc.). It covers houses, condos, co-ops, mobile homes, and houseboats.
Do You Qualify? The Eligibility Tests (Step-by-Step)
Publication 523 lays out a clear Eligibility Test. You must pass these to claim the full exclusion:
- Ownership Test: You (or your spouse on a joint return) owned the home for at least 2 years (24 months) in the 5 years before the sale. The periods don’t need to be consecutive.
- Use Test (Residence): You lived in the home as your main home for at least 2 years (730 days) in the same 5-year period. Again, non-consecutive is fine. Short absences (vacations) count. Time in a licensed care facility can count for disabled individuals.
- Look-Back Rule: You haven’t claimed the exclusion on another home sale in the 2 years before this sale.
Joint filers: One spouse needs to meet ownership; both must meet use.
Automatic disqualifications:
- Home acquired in a like-kind (1031) exchange in the last 5 years.
- Subject to expatriate tax rules.
If you don’t fully qualify, you may still get a partial exclusion for job changes (50+ miles farther), health reasons, or unforeseen circumstances (divorce, disaster, etc.). Use Worksheet 1 in Pub. 523 to calculate the prorated amount.
Pro tip: Military, intelligence, and Peace Corps members get up to a 10-year suspension of the 5-year test for qualified extended duty.
How to Calculate Your Gain or Loss (The Math Behind It)?
Follow these steps (or use Worksheet 2 in Pub. 523):
Gain = Amount Realized − Adjusted Basis
- Amount Realized: Selling price minus selling expenses (real estate commissions, legal fees, staging, advertising).
- Adjusted Basis: Original cost + improvements + certain closing costs − depreciation − casualty losses − energy credits/subsidies.
What counts as improvements? (Add to basis)
- Additions (rooms, decks, garages).
- Systems (new roof, HVAC, plumbing, electrical).
- Interior/exterior upgrades (kitchen remodels, landscaping).
What doesn’t? Routine repairs (painting, fixing leaks) unless part of a major renovation.
Examples of basis adjustments:
- Inherited home → Usually stepped-up to fair market value at death.
- Gifted home → Carryover basis from giver.
- Divorce transfer → No gain/loss; carryover basis.
If part of the home was used for business/rental, allocate the gain and recapture depreciation as ordinary income (post-May 6, 1997).
Nonqualified Use: The Post-2008 Rule That Can Bite
Gain from periods when the home wasn’t your main residence after Dec. 31, 2008, is generally not excludable. Exceptions include:
- Up to 2 years of temporary absence.
- Military duty suspensions.
- Time before 2009 or after last use in the 5-year window.
Use Worksheet 3 to allocate and subtract this portion.
Special Situations Covered in Pub. 523
- Divorce: Transfers to spouse/ex-spouse aren’t taxable sales. Surviving spouses may qualify for $500,000 if selling within 2 years of death.
- Military/Extended Duty: 10-year look-back suspension.
- Foreclosure/Short Sale: Possible cancellation of debt income (excludable through 2025 if qualified principal residence).
- Installment Sales: Spread gain over years (Form 6252).
- Destroyed/Condemned Homes: Treat as sale; exclusion may still apply.
- Energy Credits: Recent Inflation Reduction Act extensions affect basis.
How to Report the Sale on Your Tax Return?
- No taxable gain? Often, no need to report (unless you received Form 1099-S).
- Taxable gain? Report on Form 8949 and Schedule D (Form 1040).
- Depreciation recapture → Form 4797.
- Prorate real estate taxes between seller and buyer.
Always keep records for at least 3 years.
Common Mistakes to Avoid
- Forgetting to add improvements to basis (losing exclusion room).
- Missing partial exclusion opportunities.
- Not reporting Form 1099-S even if fully excluded.
- Ignoring nonqualified use or depreciation recapture.
FAQs About Selling Your Home and IRS Publication 523
- Q: Do I have to live in the home 2 full years right before selling?
No—any 2 years (730 days total) in the last 5 years. - Q: What if I sold a home in 2023 and am selling again in 2025?
You may qualify for partial or no exclusion—check the 2-year look-back. - Q: Can I exclude a loss?
No, but losses on investment property may be deductible elsewhere. - Q: Do I need a tax professional?
For complex situations (rental history, large gains, multiple properties), yes. Pub. 523 is a great starting point. - Q: Has anything changed for 2025/2026?
Mortgage debt forgiveness exclusion extended through 2025. Energy credits remain enhanced. Always verify at IRS.gov.
Final Advice: Maximize Your Tax-Free Profit
IRS Publication 523 is your roadmap to a smoother, lower-tax home sale. By understanding the ownership/use tests, tracking your basis, and using the worksheets, you can often walk away with the full $250,000/$500,000 exclusion.
Next steps:
- Download Publication 523 PDF.
- Run the three worksheets.
- Consult a CPA or enrolled agent for your specific situation.
Selling your home doesn’t have to be a tax headache. With the right knowledge from IRS Publication 523, you can keep more of your hard-earned equity.
This article is for informational purposes only and is not tax advice. Tax laws can change—refer to the official IRS Publication 523 and consult a qualified tax professional.