Capital Gains and Sale of a Residence
Quick answer
A taxpayer who owned and lived in a home for at least 2 of the 5 years before the sale can exclude up to $250,000 of gain, or $500,000 on a joint return (IRC Section 121, IRS Publication 523). For 2025 the 0% long-term gain rate applies to taxable income up to $48,350 for a single filer (Rev. Proc. 2024-40).
Last updated
Cite or share this
Key figures for 2025
- Home sale exclusion, single
- $250,000
- IRC Section 121(b)(1)
- Home sale exclusion, married filing jointly
- $500,000
- IRC Section 121(b)(2)
- Ownership and use tests
- 2 of the 5 years before the sale
- IRS Publication 523
- Long-term capital gain 0% rate (2025)
- Taxable income up to $48,350 single, $96,700 joint, $64,750 head of household
- Rev. Proc. 2024-40
- Long-term capital gain 15% rate (2025)
- Above those amounts up to $533,400 single, $600,050 joint, $566,700 head of household
- Rev. Proc. 2024-40
- Net capital loss deduction
- $3,000 a year ($1,500 if married filing separately)
- IRC Section 1211(b)
- Net investment income tax
- 3.8% over $200,000 single, $250,000 joint
- IRC Section 1411
- Unrecaptured Section 1250 gain
- Taxed at up to 25%
- IRC Section 1(h)(1)(E)
- Collectibles gain
- Taxed at up to 28%
- IRC Section 1(h)(4)
How are long-term and short-term capital gains taxed?
A gain on a capital asset held for more than one year is long-term and is taxed at 0%, 15% or 20%. A gain on an asset held one year or less is short-term and is taxed at ordinary rates up to 37% (IRC Section 1222, IRS Publication 550).
The holding period starts the day after the taxpayer acquires the asset and includes the day of sale. An asset bought on March 10, 2024 and sold on March 10, 2025 is short-term. Selling on March 11, 2025 makes it long-term.
For 2025 the 0% rate applies to taxable income up to $48,350 for single filers, $96,700 for joint filers and $64,750 for head of household. The 15% rate applies above those amounts, up to $533,400, $600,050 and $566,700, and 20% applies above that (Rev. Proc. 2024-40). Higher-income taxpayers also owe the 3.8% net investment income tax on modified AGI over $200,000 for single filers and $250,000 for joint filers (IRC Section 1411).
Some long-term gains have special rates. Unrecaptured Section 1250 gain from depreciation on real property is taxed at up to 25%, and gain on collectibles such as art and coins is taxed at up to 28%.
How are capital gains and losses netted?
Gains and losses are netted by holding period. Short-term gains and losses net together, long-term gains and losses net together, and the two results then net against each other (IRS Publication 550). Form 8949 lists each sale and Schedule D totals them.
A net capital loss offsets up to $3,000 of ordinary income each year, or $1,500 for married filing separately (IRC Section 1211(b)). The remainder carries forward without a time limit and keeps its short-term or long-term character (IRC Section 1212(b)).
Losses on personal-use property, including a home, are not deductible. Losses between related parties are disallowed. A wash sale occurs when the taxpayer buys substantially identical securities within 30 days before or after a loss sale. The loss is disallowed and added to the basis of the new shares, and the holding period carries over (IRC Section 1091).
A worthless security is treated as sold on the last day of the tax year in which it becomes worthless.
How is basis figured for purchased, gifted and inherited property?
Basis for a purchase is cost plus purchase costs and later improvements, less depreciation (IRC Section 1012, IRS Publication 551). Gain is the amount realized minus adjusted basis.
Property received as a gift takes the donor's basis for a gain. For a loss, basis is the smaller of the donor's basis or the fair market value at the date of the gift, so a gift can produce neither gain nor loss in a value range between the two (IRC Section 1015).
Inherited property takes a basis equal to its fair market value at the date of death, or the alternate valuation date if the estate elects it. The holding period is treated as long-term whatever the actual time held (IRC Sections 1014 and 1223(9)).
A taxpayer who buys a home as part of a purchase adds closing costs such as title fees and transfer taxes to basis. Costs to sell, such as the agent's commission, reduce the amount realized.
Gift vs inherited property basis: how do they compare?
A gift keeps the donor's basis, while inherited property takes its fair market value (FMV) at the date of death (IRC Sections 1015 and 1014). The difference matters most when the property has gained or lost value.
Take land with a donor basis of $50,000 and an FMV of $36,000 on the date of the gift. A sale at $58,000 uses the donor basis and produces an $8,000 gain. A sale at $30,000 uses the FMV and produces a $6,000 loss. A sale at $41,000 falls between the two figures and produces no gain or loss (IRS Publication 551).
Gift tax paid can raise the donee's basis. For gifts made after 1976, add gift tax paid multiplied by the net increase in value and divided by the amount of the gift. The amount of the gift is its value after reduction by any annual exclusion, which is $19,000 per donee for 2025 (IRS Publication 551; IRS gift tax FAQ). Suppose a 2025 gift has an FMV of $119,000, a donor basis of $59,000 and $40,000 of gift tax paid. The gift amount is $100,000 and the net increase is $60,000. The basis rises by $40,000 times $60,000 divided by $100,000, which is $24,000, to $83,000. The increase cannot lift basis above FMV (IRC Section 1015(d)).
- Starting basis: the donor's adjusted basis for a gift. FMV at the date of death, or at the alternate valuation date, for an inheritance.
- Value below the old basis: a gift gets the dual basis. An inheritance takes the lower FMV, and the unrealized loss disappears.
- Holding period: a gift taxed on the donor's basis adds the donor's holding period (IRC Section 1223(2)). Inherited property is treated as held more than one year (IRC Section 1223(9)).
- Spouses: property received from a spouse, or incident to divorce, takes the spouse's adjusted basis, and the dual basis rule does not apply (IRS Publication 551; IRC Section 1015(e)).
Which elections and assets change the stepped-up basis?
The executor can elect to value the estate six months after death instead of at death (IRC Section 2032). The election is allowed only if it decreases both the gross estate and the combined estate and generation-skipping transfer tax. It covers all estate property and cannot be revoked. Property sold or distributed within the six months takes its value on that date.
Rights to income in respect of a decedent under IRC Section 691 get no step-up (IRC Section 1014(c)).
Appreciated property that the decedent received as a gift from the heir or the heir's spouse within one year before death keeps the decedent's adjusted basis immediately before death (IRC Section 1014(e)). The heir does not take date-of-death value.
For spouses, a qualified joint interest puts one half of the value in the decedent's estate, whoever paid. Suppose a couple paid $240,000 for a home worth $600,000 when one spouse dies. The survivor's basis is $120,000 for their own half plus $300,000 for the inherited half, or $420,000 (IRS Publication 551). With community property, both halves take date-of-death value when at least half the community interest is in the gross estate. The survivor's basis is then $600,000 (IRC Section 1014(b)(6)).
Who qualifies for the home sale exclusion?
A taxpayer who owned and used the property as a main home for at least 2 of the 5 years before the sale can exclude up to $250,000 of gain, or $500,000 on a joint return (IRC Section 121, IRS Publication 523). The two years need not be continuous. Ownership and use may fall in different periods within the 5-year window.
On a joint return, either spouse may meet the ownership test, but both must meet the use test. Both spouses must also be free of any other home sale exclusion in the previous 2 years.
The taxpayer may use the exclusion only once every 2 years. A surviving spouse may use the $500,000 amount if the sale occurs within 2 years of the spouse's death and the requirements were met immediately before death.
Gain from depreciation claimed after May 6, 1997 is not excludable. It is taxed as unrecaptured Section 1250 gain at up to 25%. A loss on the sale of a main home is never deductible.
What if the taxpayer did not live there for 2 full years?
A taxpayer who sells early because of a change of workplace, health or an unforeseen event can claim a reduced maximum exclusion (IRC Section 121(c), IRS Publication 523). The reduction is the fraction of 730 days that the taxpayer did meet.
A taxpayer who lived in the home for 12 months and sold because of a job change 50 miles farther from home qualifies for half of $250,000, which is $125,000. Months of ownership and use are counted as 30-day periods or days.
Periods when the home was not used as a main home after December 31, 2008, such as time as a rental, reduce the exclusion as nonqualified use, except for time after the last day of use as a main home. Service members and certain Foreign Service and intelligence employees may suspend the 5-year period for up to 10 years.
How is a home sale reported?
A seller must report a home sale when part of the gain is taxable, when the seller chooses not to use the exclusion, or when the seller received Form 1099-S (IRS Publication 523). A seller with fully excludable gain and no Form 1099-S reports nothing.
Taxable gain goes on Form 8949 and Schedule D. The gain is long-term when the home was held more than one year.
Depreciation claimed after May 6, 1997, for example on a home office, is not excludable. It is taxed through the Unrecaptured Section 1250 Gain Worksheet in the Schedule D instructions.
Worked example: a single taxpayer sells a home with a home office
Priya, who is single, sold her main home in 2025 for $620,000 and paid $37,000 in selling costs. She bought it in 2017 for $210,000 and added $30,000 of improvements.
She claimed $12,000 of depreciation on a home office after 1997 and lived in the home the entire time.
- Amount realized: $620,000 - $37,000 = $583,000.
- Adjusted basis: $210,000 + $30,000 - $12,000 = $228,000.
- Gain: $583,000 - $228,000 = $355,000.
- Exclusion: she owned and used the home for more than 2 of the last 5 years, so she excludes up to $250,000. The $12,000 of depreciation cannot be excluded.
- Taxable gain: $355,000 - $250,000 = $105,000, made up of $12,000 of unrecaptured Section 1250 gain (up to 25%) and $93,000 of long-term capital gain.
Priya reports $105,000 of long-term gain. The $12,000 is taxed at up to 25% and the $93,000 at 0%, 15% or 20% depending on her taxable income.
Where do capital gain and home sale questions trip candidates?
- A stock is bought on June 1, 2024 and sold on June 1, 2025, and the question calls it long-term.
- The holding period starts the day after purchase, so one year is not enough. It must be held more than one year.
- A married couple sells a home. Only one spouse used it as a main home for 2 years.
- Both spouses must meet the use test for the $500,000 exclusion. Otherwise the exclusion is $250,000 for the spouse who qualifies.
- A loss on the sale of a main home is offered as a deductible capital loss.
- A loss on personal-use property is not deductible.
- Inherited stock is sold 3 months after the date of death at a gain, and the question calls it short-term.
- Inherited property is long-term regardless of how long the heir held it, with a basis equal to fair market value at death.
- A taxpayer sells shares at a loss and buys them back 15 days later.
- The wash sale rule disallows the loss. The disallowed loss is added to the basis of the replacement shares.
How does the EA exam ask about capital gains and the sale of a residence?
- A home sale with selling costs, improvements and a depreciation fact, and a question on the taxable gain.
- A purchase date and a sale date near the one-year mark, and a question on long-term or short-term treatment.
- A year with gains and losses of both kinds, and a question on the net result and the carryforward.
- A gifted or inherited asset, and a question on basis or holding period.
Sample questions
Question 1
Diane, a single taxpayer, purchased her home in 2017 and has lived in it continuously as her principal residence. She sold the home in 2025 and realized a gain of $180,000. Which statement best describes the tax treatment of this gain?
- A. The entire $180,000 gain is taxable as a long-term capital gain
- B. The entire $180,000 gain may be excluded from income under the Section 121 exclusion
- C. Only $100,000 of the gain may be excluded, with the remainder taxable
- D. The gain is excluded only if Diane purchases a replacement home within two years
Show the answer and explanation
Answer: B. The entire $180,000 gain may be excluded from income under the Section 121 exclusion
Under IRC Section 121, a single taxpayer may exclude up to $250,000 of gain on the sale of a principal residence if the ownership and use tests are met (owned and used as principal residence for at least 2 of the 5 years before the sale). Diane owned and lived in the home from 2017 to 2025, easily satisfying both tests. Her $180,000 gain is well below the $250,000 cap, so the entire gain is excludable. Option A is incorrect because the Section 121 exclusion applies. Option C is incorrect because the exclusion limit for a single filer is $250,000, not $100,000. Option D is incorrect because there is no replacement home requirement under Section 121 (that was under the old rules prior to the Taxpayer Relief Act of 1997).
Source: IRC §121; Pub 523
Question 2
In 2025, Kevin had $8,000 in capital gains and $14,000 in capital losses. After netting his gains and losses, Kevin has a net capital loss. How much of this net capital loss can Kevin use to offset his ordinary income (such as wages) in 2025?
- A. The full $6,000 net capital loss can offset ordinary income in the current year
- B. Up to $3,000 of the net capital loss can offset ordinary income, with the remaining $3,000 carried forward
- C. None of the net capital loss can offset ordinary income; it can only offset future capital gains
- D. Kevin may carry the entire $6,000 net capital loss back to amend a prior year return
Show the answer and explanation
Answer: B. Up to $3,000 of the net capital loss can offset ordinary income, with the remaining $3,000 carried forward
Capital losses first offset capital gains dollar for dollar. Kevin's net capital loss is $14,000 - $8,000 = $6,000. Under IRC Section 1211, individual taxpayers may deduct up to $3,000 of net capital losses against ordinary income per year. The remaining $3,000 carries forward indefinitely to future tax years. Option A is incorrect because the annual deduction limit is $3,000, not the full amount. Option C is incorrect because up to $3,000 can offset ordinary income. Option D is incorrect because individual taxpayers cannot carry back capital losses; they only carry forward.
Source: IRC §1211; IRC §1212; Pub 550
Question 3
Marcus purchased shares of ABC Corp stock on March 15, 2024, and sold them on March 15, 2025. He realized a gain on the sale. How should this gain be classified for tax purposes?
- A. Long-term capital gain, because he held the stock for 12 full months
- B. Short-term capital gain, because the holding period is exactly one year and does not exceed one year
- C. Long-term capital gain, because he held the stock across two tax years
- D. Ordinary income, because stock gains are always taxed as ordinary income
Show the answer and explanation
Answer: B. Short-term capital gain, because the holding period is exactly one year and does not exceed one year
The holding period for long-term capital gains treatment requires the asset to be held for MORE than one year (at least one year and one day). Marcus held his stock for exactly one year (March 15, 2024 to March 15, 2025), which means the holding period is one year or less. Therefore, the gain is classified as short-term. Option A is incorrect because exactly one year does not qualify as long-term. Option C is incorrect because spanning two tax years is irrelevant to the holding period determination. Option D is incorrect because stock gains are capital gains, not ordinary income, though short-term capital gains are taxed at ordinary income rates.
Source: IRC §1(h); IRC §1222
Frequently asked questions
Can a taxpayer exclude gain on a second home?
No. The exclusion covers only a main home, defined by where the taxpayer lives most of the time (IRS Publication 523).
Does the home sale exclusion reduce the net investment income tax base?
Yes. Gain excluded under Section 121 is not included in net investment income, so only the taxable part counts (IRC Section 1411).
Which EA exam part tests capital gains?
Part 1 (Individuals), in the Income and Assets domain. Capital asset questions also appear in Part 2 for businesses.
Sources
- IRS Publication 523, Selling Your Home
- IRS Publication 550, Investment Income and Expenses
- IRS Publication 551, Basis of Assets
- IRC Section 121, Exclusion of gain from sale of principal residence
- IRC Section 1211, Limitation on capital losses
- Rev. Proc. 2024-40, 2025 inflation adjustments
- IRC Section 1014, Basis of property acquired from a decedent
- IRC Section 1015, Basis of property acquired by gift
- IRC Section 1223, Holding period of property
- IRC Section 2032, Alternate valuation
- IRS, Frequently asked questions on gift taxes
Continue studying
More Income & Assets topics from Part 1
Interest & Dividends: Interest & Dividend Income
Income & Assets
Other Income: SS Benefits, Alimony, Other Income
Income & Assets
Rental Income: Rental Income & Expenses
Income & Assets
Retirement Income: IRA/Pension Distributions
Income & Assets
Wages & Compensation: W-2 Income & Fringe Benefits
Income & Assets
Passive Activity: Passive Activity Loss Rules
Specialized Returns
Practice this topic.
Start free.
Try the EA exam free: practice questions, no login
PSI-style questions with instant scoring and IRS-referenced explanations. Free to use, with no credit card or account.