If Your Last Years Are Spent in a Nursing Home, the IRS Still Counts the House as Your Home, and the Full $500,000 Tax Break Survives the Sale
A buried IRS provision quietly changes the rules for homeowners who spend years in a nursing facility before selling, and most families discover it too late to benefit.
This post may contain links from our sponsors and affiliates, and Flywheel Publishing may receive compensation for actions taken through them.
If you own your home and worry that a long stay in a nursing facility could wipe out your capital gains tax break when the house is sold, a specific IRS provision addresses exactly that situation. Section 121 of the Internal Revenue Code, the rule that lets qualifying homeowners exclude a large chunk of gain from a home sale, contains a carve-out that treats time in a licensed care facility as if you were still living in the house. Most people never hear about it until a family member is already in care.
What the Standard Home Sale Exclusion Requires
The general Section 121 rule is straightforward. To exclude gain on the sale of a principal residence, you must have owned and used the home as a principal residence for a set period within the five years before the sale. The standard tests require two years of ownership and two years of use within that five-year lookback. The exclusion caps at $250,000 of gain for a single filer and $500,000 for a married couple filing jointly. Note the word gain, not sale price. Gain is what remains after subtracting your cost basis (what you paid plus qualifying capital improvements) from the net sale proceeds. On a home held for decades, especially with the Case-Shiller National Home Price Index at 336.7, that gain can be much larger than owners expect.
A multi-year nursing home stay would normally break the two-year use test and eliminate the exclusion entirely.
Buried Rule That Rescues the Exclusion
Under IRC Section 121(d)(7), if a homeowner becomes physically or mentally incapable of self-care, the use test is relaxed. The seller needs only one year of use as a principal residence during the five-year lookback, and any time spent in a state-licensed or government-licensed facility counts as use of the home. The clock does not run out just because you moved into qualifying care.
The ownership test still applies on its normal terms, so title must have been in the seller’s name for the required period.
Who Qualifies and Who Does Not
The relaxed use rule is tied to incapacity, not age or convenience. A homeowner who moves in with adult children, into independent living, or into an unlicensed assisted arrangement will not get the benefit. The facility must be licensed for the level of care the person needs, which is why the distinction between a licensed nursing facility and other housing arrangements matters. A physician’s determination that the person cannot care for themselves typically supports the claim.
Single Filer, Married Couple, and the Widow Window
The $500,000 exclusion applies to married couples filing jointly. A single filer, which includes widows and widowers, is capped at $250,000. Since many people enter nursing care alone, that smaller number often applies.
There is an exception for surviving spouses. They can claim the full joint exclusion if the home sells within two years of the spouse’s death, as long as the couple would have qualified right before the death and the survivor has not remarried. Selling inside that window can make a real difference for a widowed seller heading into care.
How to Actually Use It
- Confirm the care facility is licensed for the resident’s level of care and keep documentation of licensure.
- Get a physician’s statement establishing incapacity for self-care.
- Track the ownership timeline against the five-year lookback and confirm at least one year of pre-care use as a principal residence.
- Rebuild cost basis: original purchase price, closing costs, and qualifying capital improvements.
- If widowed, calendar the two-year window from the spouse’s date of death.
Catch Worth Flagging Before Anyone Signs a Listing
Two traps. First, this is a tax rule. It does not address Medicaid. Selling the home to capture the Section 121 exclusion can convert an exempt asset into countable resources and disrupt Medicaid eligibility or trigger estate recovery later, so this frequently intersects with Medicaid planning, where selling the home has separate consequences that a tax answer alone does not address.
Second, the exclusion covers gain, not proceeds. A long-held home can generate gain well above the cap, leaving a taxable slice regardless of the special use rule. That housing backdrop is worth watching too: existing home sales are at 4.06M annualized as of July 2026, down 1.7% from the prior month, which falls in the range the source describes as a soft market. A CPA who coordinates with an elder-law attorney is the right stop before any sale.
Contact [email protected] for any questions or corrections.








