To clarify. The current law. If you sell your home and have a gain (capital gain) on the sale of that house, you may be subject to income tax on investment capital gains. However, just like everything, there are limits, exemptions, etc.
If you are filing single, you can exempt the first $250,000 of capital gains from selling your house.
If you are married filing jointly, you can exempt the first $500,000 of capital gains from selling your house.
What does this mean: If you sell your house and the gain (sales price less purchase price) from the sale is LESS than those above limits, you are not subject to include this gain on your tax return, and in return, will not be subject to capital gains tax.
NOW, HOW DOES THIS NEW LAW WORK:
The same exact way. If your capital gain on the sale of your house is LESS than those amounts listed above, you will not be subject to the 3.8% tax (for medicare). Please remember, the 3.8% is only on the amount that exceeds the above stated amounts (i.e. if you have $550,000 in gain from sale of house, only $50,000 will be subject to the 3.8% tax if married filing joinly).
Now, with all of this said, the republicans are currently in the process of taking Obamacare and repealing (or whatever you call it) in it's entirety. This means that everything associated with Obamacare, including this 3.8% tax on capital gains, and the requirement to continue health insurance for children until 26 years old, no matter whether in college or not, will all go bye bye (until the republicans can come up with their own version, in a different bill that then one set to repeal Obamacare).
I hope I clarified enough.