It is a tax. It is not a sales tax. It's a tax on investment profit.
Add up all of your income from every possible source, and if that total is less than $200,000 ($250,000 on a joint tax return), this tax does not apply to you.
For this tax to apply to profit or gain on a primary home sale (the home you are living in for 5+ years), the
profit/gain must be more than the $250,000-$500,000 capital gains exclusion which is already in place. This is not based on the sales price; it is based only on the gain (profit).
Yes, the tax does apply to other types of investment income. If your income is more than the $200,000/$250,000 amount, the tax formula will be applied to capital gains, interest income, dividend income and net rents (i.e., rents after expenses).