My understanding is that the tax is on the gain, but, of course, you have to make over the income threshhold.
For example, if you are single and making $175,000 a year and sell a second home for $100,000 profit, you owe nothing. If you are single making $225,000 and sell your second home for $100,000 profit, you’ll pay $3800 in addition to any other capital gains tax you might pay.
And I am not a tax professional and this is not tax advice.
What a nightmare this administration is. Figures when I finally get mine, the country goes communist. (: