Home Sale Exclusion: Tax Savings on Capital Gain of a Principal Residence
Section 121 of the Internal Revenue Code (https://www.irs.gov/pub/irs-drop/rr-14-02.pdf) allows the exclusion of a realized capital gain of up to $250,000 ($500,000, if married filing jointly) from income if it is the sale of the taxpayer's principal residence.
To qualify for the exclusion:
- you must have owned and lived in the house as your primary residence for at least an aggregate of 2 years out of the previous 5 years before the sale (12 months for the mentally or physically disabled)
- the 2-year use and ownership periods can be at different times
- the time periods do not have to be continuous
- the home was not acquired through a like-kind (§1031) exchange or received as a gift from a donor who acquired it as like-kind exchange
- you did not claim the §121 exclusion within the prior 2 years
- and the expatriate tax does not apply to you
Grantor trusts and single-owner entities can also claim the exclusion. A gain on a conversion, such as when a home is destroyed or condemned, can also be excluded.
Form 1099-S, Proceeds from Real Estate Transactions is used to report the sale of a residence. If the gain is wholly excludable, then no Form 1099-S needs to be filed (IRS Revenue Procedure 2007-12). The settlement agent who closed the sale of your principal residence must report the sale to the IRS on Form 1099-S if the sales price exceeds $250,000, or $500,000 for married filing jointly. However, if the sales price is less than the gain-exclusion limits, and you know that your gain will be excluded, and you certify as such in writing to the settlement agent, then the agent may rely on that certification and not file Form 1099, though the agent is still free to do so. If the gain is not fully excludable, then Form 1099-S must be filed.
If the gain fully qualifies for the exclusion, then the sale may not even have to be reported on your tax return. However, the sale must be reported on Form 8949, Sales and Other Dispositions of Capital Assets if:
- you received Form 1099-S
- you have a taxable gain
- or you decide not to claim the exclusion
You may not want to claim the exclusion if you intend to sell another property with a larger excludable gain within a 2-year period of this sale.
Any amount above the exclusion amount is subject to the long-term capital gains tax that, since 2013, depends on income:
Capital Gains Rate
|Single ||Head |
Additionally, since 2013, any gains above the exclusion amount will also be subject to the new Net Investment Income Tax, which can add as much as 3.8% to the applicable gain for taxpayers who earn, both from work and from investments, at least the threshold amount (joint filers: $250,000, everyone else: $200,000).
The period of ownership and use can be discontinuous as long as they satisfy the 2- and 5-year test. Short absences, such as for vacations, are included in the time of use test.
If vacant land was owned and used as part of your principal residence, then the sale of the vacant land may qualify for the exclusion if it was sold within 2 years, either before or after, the sale of the principal residence. However, the sale of the vacant land and the principal residence is treated as 1 sale, so the exclusion applies to the combined sales. The exclusion limit applies 1st to the sale of the residence if the sale of the vacant land and the residence occurred in different tax years.
The gain on a sale of a remainder interest to an unrelated party may be excluded, but any gains on subsequent sales of remainder interests cannot be excluded. Gains on sales to related parties may not be excluded, which not only includes close relatives, but also business organizations in which you have a significant interest.
If your home is financed with the federal subsidy, such as a tax-exempt bond or a qualified mortgage credit certificate, then the subsidy cannot be excluded, which is calculated on Form 8828, Recapture of Federal Mortgage Subsidy.
Example: How to Maximize the Home Sale Exclusion with the Main Residence and Vacation Property
- An older couple, with an income of $600,000, owns a main residence in which they lived 25 years.
- They also own a beach house they owned for 15 years.
- They plan to retire to Florida, but before they do, they sell their main residence for a realized gain of $600,000.
- They can exclude $500,000 of that gain from income, but they must pay the applicable long-term capital gains tax of 20% + the net investment income tax of 3.8% on the remaining $100,000, resulting in a total tax of $23,800 on the non-excluded portion.
- Then they move into their beach house and live there for 5 more years.
- Living there for 5 more years instead of just 2 years increases the amount excludable to the maximum amount, because the time period before being used as a primary residence is a nonqualified use, which will reduce the amount excludable. However, the reduction in the exclusion amount will depend on how long you own the property and on the length of nonqualified use after 2008. More on this later.
- A benefit to living there for 5 more years is that the gain may be significantly larger, especially for hot real estate markets.
- Afterwards, they sell their beach house for a gain of $300,000, all of which is excludable from income.
An involuntary conversion occurs if a property is destroyed or condemned. If a gain was postponed under §1033, because of an involuntary conversion of a principal residence, then the holding period of the replacement residence includes the holding period of the previous residence.
If a homeowner becomes incapacitated, and must spend time in a licensed care facility, then the homeowner can still exclude the gain if the principal residence was used at least 1 year during the 5 years preceding the sale. The 2-out-of-5 year ownership test still needs to be satisfied, however.
The years of ownership test can be suspended for up to 10 years by military and Foreign Service personnel, Peace Corps workers, and intelligence officers that are on official extended duty.
If the taxpayer has more than 1 home, then only the principal residence qualifies for the exclusion, which is generally determined by the length of occupancy of each residence, but the IRS may also consider the taxpayer's place of employment, addresses on driver's licenses, automobile and voter registrations, and the mailing address used in correspondence. Undeveloped land may also qualify for the exclusion if it is adjacent to the principal residence and was used as part of the residence, and both land and the residence are sold within a 2-year period. However, the exclusion limit applies to both the land and the principal residence, not to each independently.
The exclusion can also be applied to mobile homes, trailers, condominiums, and even houseboats if they were used as a principal residence. However, if the home is moved to a different location, then any sale of the vacant land does not qualify for the exclusion. However, an investment in a retirement community only qualifies if the taxpayer receives equity in the property. For the tenant stockholder of a cooperative, the ownership requirement requires the ownership of the stock and the use requirement applies to the unit that the stockholder owns.
The §121 exclusion can only be used once every 2 years. This is to prevent taxpayers from buying multiple residences to earn tax-free income.
Because of the 2-year exclusion period, a taxpayer may choose to not exclude the gain on a residence if he intends to sell another residence that will also qualify for the exclusion but would be within the 2-year period of the 1st sale. A taxpayer may do this if she expects the gain may be greater on the 2nd sale.
Joint owners may each claim the $250,000 exclusion for their share of the gain.
Married Couples Can Claim a $500,000 Exclusion
A married couple must satisfy the following requirements for the $500,000 exclusion:
- married filing jointly;
- either spouse owned the residence for at least 5 years;
- the residence was a principal residence for both spouses for at least 2 years;
- neither spouse claimed a §121 exclusion within 2 years of the sale of the principal residence.
If only one spouse lived in the house as a principal residence, then only that spouse can claim the $250,000 exclusion. If a married couple has separate residences, then each may claim a $250,000 exclusion on the sale of their residence, whether they file jointly or separately.
United States citizens who have renounced their citizenship or long-term residents who have ended their residency for the purpose of avoiding United States tax cannot claim the exclusion.
Death of Spouse If the spouse dies before the sale of the residence, then the surviving spouse can add the years that the decedent lived in the house as a principal residence, and can also still exclude a $500,000 gain. The surviving spouse is considered to have the property at least as long as the decedent unless the spouse remarries before the sale. The surviving spouse must file a joint return, however, in the year of the spouse's death. The surviving spouse will still qualify for the $500,000 exclusion if the property is sold within 2 years of the deceased spouse's death. Note also that the portion inherited from the deceased spouse will receive a stepped-up basis, which will further reduce any taxable gain. This stepped-up basis will equal the fair market value (FMV) of the portion of property on the date of death or, if the personal representative so chooses, the FMV of that portion 6 months afterward. A surviving spouse in a community property state will receive a stepped-up basis for the entire property. The $500,000 exclusion can also be applied if the residence is sold within 2 years of both spouses' death if the couple would have qualified otherwise.
Divorce If a spouse receives a residence under a divorce decree, then her time of ownership and time of use is added onto the ex-spouse's time of ownership and use. If one spouse moves out pursuant to a divorce or separation decree, then the relocating spouse can continue to claim use and ownership for as long as he maintains an ownership interest in the property, and as long as the remaining spouse continues to use the residence as a principal residence.
The home sale tax exclusion is more of a benefit to the wealthy, because they could buy more expensive homes, then resell them a few years later and claim most or all the exclusion. On the other hand, taxpayers with less expensive homes must own the home for many years, or even decades, to take advantage of the full exclusion.
Prorated Maximum Exclusion
If the taxpayer was forced to sell their home before qualifying for the exclusion because of a change of employment, health problems, or some other unforeseen circumstances, either for the taxpayer, a close family relative, or to other members of the house who have an ownership stake in the house, then the taxpayer can still qualify for an exclusion, but the maximum exclusion is reduced to a percentage, equal to the shortest time that the taxpayer did satisfy either the use or ownership test or the length of time since last claiming the exclusion divided by 730 days (2 years).
So if you are single and lived or owned your home for 1 year and it has been at least 1 year since you last claimed the exclusion, then you can claim 365/730 = ½ of the $250,000 limit. Therefore, the most that you can exclude is $125,000. Note that if your gain is less than this, then you can exclude the full gain.
A married couple filing jointly can add the 2 limits together.
So if you’re married filing jointly and you lived in the house for only 1 year, but your spouse lived in the house for 2 years, before selling your house because either you or your spouse accepted a new job that was at least 50 miles further away than the previous job, then the limit for you will be $125,000 (= 365/730 × $250,000), just as in the previous example, plus $250,000 (= 730/730 × $250,000), for your spouse, for a total limit of $375,000. If your gain is less than that, then you can claim the full exclusion.
Safe Harbor for a Prorated Exclusion
Generally, to satisfy the requirements for a prorated exclusion, the IRS considers the facts and circumstances of the situation to decide whether the applicable rules apply. However, the IRS does provide a bright line to distinguish whether the rules allow the prorated exclusion. The change of employment rule is satisfied if the taxpayer's new job location is at least 50 miles further than the old job location from the primary residence and the taxpayer was using the primary residence at the time of the job change. The change of employment includes working for the same employer but in a different location or a change in location for a self-employed worker. The safe harbor can also be satisfied if an unemployed taxpayer obtains a job that is more than 50 miles away from the sold residence.
When the IRS considers facts and circumstances, the most important factor will be the primary reason for the home sale. Thus, the primary reason for the sale must have been because of the change of employment, deteriorating health, or other unforeseen circumstances.
The health rule is satisfied if the change in location was to better manage the health problems of the taxpayer or a close relative, but not just because the taxpayer wanted to move to a healthier environment. However, a safe harbor exists if it was done on the recommendation of a doctor. So if the taxpayer sells his home to care for an ill parent, then the rule is satisfied.
Unforeseen circumstances includes any factor that would make the house unaffordable, or a change in financial status that would make it difficult to maintain the home, such as the involuntary conversion of a home, or damage from disasters; or death, divorce, or legal separation or even a change in employment with a reduced income making it hard for the taxpayer to afford the house. The unforeseen circumstance must not have been anticipated before the house was bought and occupied. So, for instance if a unmarried couple buy a residence so that they can live together, but later they break up, then this would be considered an unforeseen circumstance, especially if the remaining taxpayer is unable to afford the housing by herself.
The gain on the sale of the house is considered the sale price minus any selling costs, such as a real estate brokerage commission, minus the adjusted basis of the property. The adjusted basis of the property includes the purchase price plus expenditures for improving the property. It does not include expenditures for just repairing the property. Settlement fees and closing costs also add to the adjusted basis of the property. However fees associated with obtaining a mortgage do not affect the basis of the property, since those fees are charged for getting the loan, not for the purchase of the property.
Figuring Adjusted Basis
The capital gain or loss is calculated thus:
Sale Proceeds = Sale Price − Selling Costs (commissions, advertising, legal fees, etc.)
Total Gain or Loss = Sale Proceeds − Adjusted Tax Basis
Capital Gain or Loss = Total Gain or Loss − Depreciation
Anything that changes that taxpayer's basis in the property will affect the gain or loss realized. Expenditures that increase the adjusted basis include:
- improvements with a useful life exceeding 1 year;
- costs of restoring damaged property.
Factors decreasing the adjusted basis include:
- postponed gains from the sale of a previous home before May 7, 1997;
- any losses that were deducted from ordinary income tax;
- insurance payments for casualty losses;
- depreciation claimed for a home business or rental purposes;
- claimed tax credits for home energy improvements that increases the basis of the home;
- energy conservation subsidies that were excluded from income; and
- receipts from a public utility for energy conservation measures that was excluded from gross income.
Gains postponed under prior law rollover rules decrease the basis because taxes were not paid on the gains previously.
Improvements to a home only increase the basis if they are still part of the home. For instance, if you spent $4000 to paint your house 10 years ago, and then painted the house again just before the sale, then the previous cost of the painting is not added to the basis.
Long-term gains on a house are taxed at the long-term capital gains rate, but if you claimed a home office, then the depreciation is recaptured at a different tax rate, equal to the lower of your ordinary marginal tax rate or 25%. The rest of the gain will be subject to the capital gains tax rate.
Recordkeeping Records of all adjustments to the basis of the home, including any receipts of costs, should be kept for at least 3 years after the due date of filing for the tax year of the home sale.
Business Use Of The Home
If you have a home office that is part of the dwelling, then the gain on that part of the dwelling is also excludable along with the rest of the residence. However, any depreciation claimed on the property after May 6, 1997 is not excludable and must be reported on Schedule D, Capital Gains and Losses as unrecaptured §1250 gain, which is taxed at the lower of 25% or your marginal tax rate.
Example: Figuring Unrecaptured Gain on a Home Office
- You sell your home for a gain of $20,000.
- $5000 was claimed for depreciation on a home office.
- Therefore, only $15,000 is excludable from income.
- The $20,000 gain and the $15,000 exclusion are reported on Part II of Form 8949, Sales and Other Dispositions of Capital Assets, and Schedule D, Part II.
- The $5000 depreciation recapture can be figured using the Unrecaptured Section 1250 Gain Worksheet in the Schedule D Instructions, then entered in Part III, Summary section of Schedule D, Capital Gains and Losses.
No loss on the sale of a personal residence is deductible. However if part of the home was rented out or used for business, then the allocable space reduced by the allocable time that it was used for business is deductible.
When a residence is converted to rental property, then the tax basis on the conversion date is the lower of the adjusted basis or the fair market value. Generally, if a residence was converted to rental property only a few months before the sale, then whether any losses are deductible depends on whether the rental returns a profit and whether the lease prevented the owner from reoccupying the house during the lease period.
If a house was bought for resale, then losses are deductible, even if the owner occupied the house for several months before the sale. In these cases, it is presumed that the owner does not intend to live in the house as a primary residence, but occupies the house to prevent vandalism and to keep the house in good shape to sell. Deductible losses can also be claimed for a residence that was acquired by gift or devisement, if the donee had no intention of living at the residence but sold it or rented it out shortly after acquiring it.
If the principal residence is owned by a partnership whose partners are married, then the gain on the sale cannot be excluded but must be recognized.
Nonqualified Use of a Residence
If a residence is not used as a primary residence, then it is a nonqualified use except:
- if the applicable time period was before 2009;
- any time period after the property was used as a primary residence;
- any time period in which the taxpayer was on qualified official extended duty as a member of the Armed Forces, Foreign Service, or as an intelligence community employee;
- any period of less than 2 years that was a temporary absence caused by a change of employment, health conditions, or other unforeseen circumstances.
The gain on a residence that can be excluded is reduced proportionally by the amount of time of nonqualified use, including the nonqualified use before the 5-year lookback period, but after 2008. This is how nonqualified use modifies the excludable gain according to the worksheet in Publication 523, Selling Your Home :
Non-Use Days = Total Days after 2008, When Neither You nor Your Spouse or a Former Spouse Used the Home As a Main Residence
Total Days of Ownership = Total Days You Owned the Property (including before 2009)
Non-Residence Factor = Non-Use Days / Total Days of Ownership
Capital Gain = Total Gain – Depreciation
Nonqualified Gain = Capital Gain × Non-Residence Factor
Allocable Gain Qualified for Exclusion = Capital Gain − Nonqualified Gain
The nonqualified use provision prevents longtime owners of rental properties or vacation properties from moving into 1 of the properties to live in it for 2 years, then selling it to claim the home sale exclusion. Though the exclusion can still be claimed, it will be substantially less than it would be if there was no nonqualified use within the 5-year lookback period.
Calculating the Home Sale Exclusion for a Home with Nonqualified Use
- You bought rental property on January 1, 2010,
- and rented it until December 31, 2019,
- then moved in on January 1, 2020 and lived there until you sold it on January 1, 2022.
- Total Gain = $300,000
- Depreciation = $60,000
- Capital Gain = Total Gain − Depreciation = $240,000
- Nonuse Days = 3650 (not counting leap days)
- Total Days of Ownership = 4380
- Non-Residence Factor = 3650 / 4380 = 0.833 (IRS instructions specify using the factor to 3 decimal places.)
- Taxable Nonqualified Gain = $240,000 × 0.833 = $200,000
- Gain Qualified for Exclusion = $240,000 − $200,000 = $40,000
You will only be able to claim 1/6 (= 1 − 10 years/12 years = 1 − 5/6) of the exclusion that you would otherwise be entitled to. If your capital gain was $240,000, then you would only be able to exclude $40,000, 1/6 of $240,000. Only by owning the property for an additional 3 years so that none of the nonqualified use is within the 5-year lookback period would you be able to claim the full exclusion.
Note, that you could rent the house for an additional 3 years after you have lived in it for 2 years and still be able to claim the full exclusion, because the rental period after your use as a primary residence is qualified, so it does not reduce your exclusion. Rental property will also have depreciation, which is not excludable and is taxed at a rate equal to the lower of your marginal rate or 25%. So if your tax bracket is higher than 25%, then the tax on the recaptured depreciation in the above example = $60,000 × 25% = $15,000.
- You buy a house for $400,000 in January 1, 2016.
- You rent it out for the first 2 years, or 731 days.
- Then you moved in and used it as your primary residence for 730 days.
- You use part of the house for a home office and claimed total depreciation of $20,000.
- Then you move out and sell it 366 days later on January 1, 2021 for $620,000.
- Since you rented the property out for the first 2 years, or 731 days, only 1,096 days out of your 5 years, or 1,827 days (including 2 leap years) of ownership is a qualified use.
- Since you deducted a total of $20,000 for depreciation, this must be subtracted from your excludable gain before the allocation of the gain to the qualified use period:
- Realized Gain = $620,000 − $400,000 = $220,000
- Capital Gain = Total Gain − Depreciation = $220,000 − $20,000 = $200,000
- Nonqualified Gain = 731 / 1827 × $200,000 = $80,022
- Amount of Capital Gain Allocable to the Qualified Use Period = Capital Gain − Nonqualified Gain = $200,000 − $80,022 = $119,978
Out of a total gain of $220,000, you can exclude $119,978 from your income. Note that even though you did not live in the house in the last year of your ownership, it is still considered a qualified use since that was after you had used the house as a primary residence.
Allocable Gain on Separate Structure Used for Business Cannot Be Excluded
If the residence has a separate structure from the dwelling unit that was used for business or rental after 2008, then such use is considered a nonqualified use subject to the nonqualified use rules discussed above. Thus, the gain attributable to the nonqualified structure and allocable to the nonqualified use period will be taxable even if the 2-year use test is satisfied.
If a separate structure was used for business or rental for more than 3 years during the 5-year period previous to the sale, then the gain allocable to the separate part is not excludable since it does not satisfy the 2-year test. A taxable gain must be reported on Form 4797, Sales of Business Property.