The 3.8% Medicare Surtax on the sale of a primary home (in general on investment income) effective in 2013 applies to very few people.
1) The net profit from the sale of the primary residence must be over $250K for singles, and $500K for married. Any amount over those is classified as investment income and is subject to capital gain tax also.
2) Additionally, for the 3/8% to apply, the seller must have Adjusted Gross Income (AGI)of over $200K for singles ($250K for married).
3) The 3.8% is levied on the smaller of the net investment income or the excess of AGI over the threshold.
To qualify for $250/$500k home-exemption, one must have lived in their primary home for 2 years out of 5 years prior to the sale. Note, the investment income is not subject to the home-exemption.
Disclaimer: Please consult your tax professional for details and how the law applies to your special situation.