Definition
For U.S. tax, a person who is not a U.S. citizen and does not meet the green card test or the substantial presence test; taxed only on U.S.-source income.
What it means
In U.S. tax law, a nonresident alien is someone who is not a U.S. citizen and is not a U.S. resident for tax purposes, meaning they do not hold a green card and do not pass the substantial presence test based on days spent in the United States. Nonresident aliens are taxed by the U.S. only on income from U.S. sources and on income connected with a U.S. business. U.S.-source income that is not connected with a U.S. business, such as many royalties, is generally taxed at a flat 30% rate or a lower treaty rate, usually through withholding. Tax residency is separate from immigration status: a visa holder can be a resident for tax, and a person living abroad who earns from U.S. platforms is usually a nonresident alien.
Example
A video editor living in the Philippines who works for U.S. clients from home and never visits the U.S. is a nonresident alien for U.S. tax.
Illustrative numbers only. Your situation will differ.