Investment income is generally treated as not effectively connected with a U.S. trade or business. This includes dividends, capital gains, rental income, and interest, with the exception of bank interest. Interest received on deposits held in the "banking business" is excluded from nonresident aliens' income; they need not even report it.
The exemption of bank interest applies only if it is not connected with a U.S. trade or business. Thus the exemption may be lost if a nonresident holds large sums in a bank for the purpose of earning money.
The "banking business" includes commercial banks, mutual savings banks, cooperative banks, credit unions, domestic building and loan associations, and other savings institutions chartered and supervised as savings and loans or similar associations under federal or state law.