Form 1042-S is used to report amounts paid to foreign persons (including persons presumed to be foreign) that are subject to income tax withholding, even if no amount is deducted and withheld from the payment because of a treaty or exception to taxation, or if any amount withheld was repaid to the payee. It is also used to report amounts withheld under Chapter 3 of the Internal Revenue Code. Additionally, Form 1042-S can be used to report distributions of effectively connected income by a publicly traded partnership or nominee.
A nonresident alien is an individual who is not a citizen or resident of the United States and should be filing their return using Form 1040NR. Different rules may apply if married; see IRS Publication 519 U.S. Tax Guide for Aliens for more information.