As a nonresident alien, your income is either effectively connected to a U.S. business or is not effectively connected to a U.S. business. Effectively Connected Income (ECI) is taxed at the regular graduated rate. If your income is Not Effectively Connected (NEC), it is generally taxed at a 30% rate. However, if your resident country has a tax treaty with the U.S., the rate may be lower or the income may be exempt from tax. Income is reported depending on whether or not it is ECI.
Per IRS Effectively Connected Income (ECI) webpage, generally, when a foreign person engages in a trade or business in the United States, all income from sources within the United States connected with the conduct of that trade or business is considered to be ECI. This applies whether or not there is any connection between the income and the trade or business being carried on in the United States during the tax year. You usually are considered to be engaged in a U.S. trade or business when you perform personal services in the United States. Whether you are engaged in a trade or business in the United States depends on the nature of your activities.
Per IRS Publication 519 U.S. Tax Guide for Aliens, tax at a 30% (or lower treaty) rate applies to certain items of income or gains from U.S. sources but only if the items are not effectively connected with your U.S. trade or business. Income which is NEC may include, but is not limited to, interest and dividends from businesses in which you are not engaged, income from real property, and gambling winnings. These amounts are reported on Schedule NEC (Form 1040).
Items reported on Schedule NEC should not be reported anywhere else on your return. Any ECI items should be reported on their respective lines on Form 1040-NR U.S. Nonresident Alien Income Tax Return.
Note that any link in the information above is updated each year automatically and will take you to the most recent version of the document at the time it is accessed.