In January, the fabled 3.8% surtax on investment income becomes law. This surtax, included in health care legislation to bolster Medicare’s finances, is based on two key numbers. The IRS has just issued proposed regulations on one of those numbers: net investment income.

The other key number–modified adjusted gross income–is relatively easy to determine. For this surtax, MAGI is usually the same number as the AGI reported on a tax return. The 3.8% surtax will affect taxpayers with MAGI over these thresholds: $250,000 for married couples filing jointly and qualifying widow(er)s with a dependent child; $200,000 for singles and heads of household (with a qualifying person); and $125,000 for married individuals filing separately.

For taxpayers over the threshold in a given year, that year’s net investment income (NII) must be determined. The 3.8% surtax will be imposed on whichever is smaller: NII or the excess of MAGI over the relevant threshold.

What is NII for this purpose?

The IRS has said NII will include interest, dividends, capital gains, rental and royalty income, non-qualified annuities, income from businesses involved in trading of financial instruments or commodities, and businesses that are “passive activities” to the taxpayer. Social Security benefits, alimony, tax-exempt interest, and distributions from many types of retirement plans are not considered NII, for this surtax.

NII is determined after adding up all the forms of income to be included, then deducting investment expenses. Those expenses, according to the IRS, might be investment interest expense, investment advisory and brokerage fees, expenses related to rental and royalty income, and state and local income taxes properly allocable to items included in NII.

In the NII FAQ, the IRS gives special attention to sale of a primary residence. Essentially, profits on a home owned and occupied for at least two of the five preceding years are tax-exempt, up to $250,000, or up to $500,000 for a couple filing jointly.

Suppose, for example, Jim and Joan Smith sell a home where they’ve lived for many years. Their realized gain on the sale is $600,000. Under the tax law, the first $500,000 is exempt from capital gains tax while the other $100,000 is subject to tax. Similarly, on this $600,000 gain only $100,000 would possibly be subject to the 3.8% surtax, depending on the Smiths’ MAGI.

If, for example, the Smiths’ MAGI that year is $300,000 and their other NII is $125,000, the Smiths total NII would be $225,000. With $300,000 in MAGI, the Smiths would be $50,000 over their $250,000 MAGI threshold, and $50,000 is smaller than their $225,000 NII. The 3.8% surtax will be imposed on $50,000, the smaller of the two key numbers, so the Smiths’ surtax would be $1,900: 3.8% of $50,000.