Capital Gains on Townhouse Sale

How should the owners calculate their capital gain on a townhouse they have both lived in and rented?

Q: We are selling our townhome this year that we bought almost 30 years ago. We lived there first for 17 years, as a primary residence and then we rented it. How do I calculate capital gains tax? Do we use the sales price or do we use the market price when we began renting it out?

A: Your question seems simple, but it’s actually complicated. We don’t have enough information from you to give you a detailed answer, so we’ll make a few assumptions and provide some general advice. But, you’ll definitely want to talk with your tax preparer or someone who has experience with calculating the capital gains tax owed on investment property.

Primary House Tax Break

Let’s start with the obvious: You’ve owned the property for a long time. Let’s assume you purchased your townhome for $100,000 and are selling it for $1,000,000. If you subtract the purchase price from the sales price, you might think you have a profit of $900,000. Like most homeowners, we’ll assume you made improvements to the home over time. In addition, we believe you paid something to buy it and will incur expenses when you sell.

Some of the improvements reduce your profit, as do the costs of purchase and sale. Some of these expenses include commissions paid to real estate agents, fees paid to settlement agents, transfer taxes, recording fees, and many other items. If you put in a new kitchen for $50,000, you should be able to exclude that amount from the profits from the sale of the home.

Calculating Capital Gains

The first step in calculating your cost basis is getting your paperwork together. Think about any material changes you made to the home (additions, roof replacement, plumbing or electrical upgrades, etc.) and add up those costs. For more detailed information on what expenses are allowed, see IRS Publication 523 on the IRS website.

If you never rented your townhome and were just selling it, you could add up all of these material costs, plus the cost of buying and selling, and subtract it from the sales price. This would give you your profit.

But renting your townhome will impact your profit. While you rented the home, you should have reported the rental income. In addition, you would have been able to deduct the interest you paid on your mortgage (if you still had it) and a myriad of other expenses. In addition, you should have received a tax break – the ability to depreciate the value of the home over time.

How Do I Avoid Capital Gains Tax for Jointly Owned Property?

Now that you’re selling,, the federal government will tax you on the amount of depreciation you took over those years that you rented the property and owned it as an investment property.

Back to our example. Let’s say you spent $100,000 improving the property while it was rented but took $50,000 in depreciation. And, finally, we’ll assume you had $100,000 in expenses from the purchase and sale of the home.

Your numbers would now look as follows: The purchase price was $100,000; the sales price was $1,000,000, resulting in a $900,000 profit. We would reduce that profit by the $100,000 cost of purchase and sale plus another $100,000 from the improvements you’d put into the home. That means your true profit is $700,000, which is the amount on which you’ll pay long-term capital gains tax. Unless there are extenuating circumstances, your tax rate would be 20 percent.

How Do I Avoid Capital Gains Tax on the Sale of a Second Home?

But wait, there’s more! In addition, you’d have to pay a 25 percent tax on $50,000 in depreciation that you took while you owned the property. This is known as “recapture.” The federal government also charges an additional tax of 3.8 percent tax on capital gains from real estate. This is the net investment income tax.

If you only rented out the property a short time, you might be able to take advantage of another tax break. Homeowners who have lived in their home for two out of the last five years would get to exclude from capital gains the first $250,000 of profits if you are single or up to $500,000 in profits if you are married. You wouldn’t qualify for this exclusion as you stopped living in the home as your primary residence many years ago.

How Are Capital Losses Deducted?

We’ve glossed over the numbers to give you a general idea of what you might owe. But please consult with a tax professional to go through the details of your ownership and figure out exactly what you will owe the federal government and your state, if your state has an income tax.

©2025 by Ilyce Glink and Samuel J. Tamkin. Distributed by Tribune Content Agency. A1681

Sign up for Ilyce’s Love, Money + Real Estate newsletter