As a nonresident alien, you are engaged or considered to be engaged in a trade or business in the United States during the calendar year. If you are or were temporarily present in the U.S. on any of the “F”, “J”, “M,” or “Q” visa, you need to file either Form 1040NR or 1040NR-EZ. However, you need to know that if the wages you earn from your only U.S. source of income are less than the personal exemption amount, then you are not required to file. The amount of personal exemption for 2016 is $4,050. Generally, a nonresident alien, single or married, can claim only one personal exemption for himself, as long as he/she is not claimed as a dependent on any other U.S. tax return. There are a few exceptions to this rule, which you can find here. However, if your only U.S. business activity is trading in stocks, securities, or commodities (including hedging transactions) through a U.S. resident broker or other agents, you are NOT engaged in a trade or business in the United States.
You must file a return if you have U.S. income on which the tax liability was not satisfied by the withholding of tax at the source, even if you are not engaged in a trade or business in the United States.
You should also file an income tax return if you want to claim a refund of excess withholding or the benefit of any deductions of credits (for example, if you have income from a rental property you choose to treat as income that is connected to a trade or business).