As a non-resident alien foreign national in the United States, if you breach the Substantial Presence Test (SPT) then you become a U.S. resident alien who is taxable in the U.S. on your worldwide income. (In any calendar tax year through U.S. presence that is in excess of 183 days, with a two-year look back test that accrues additional days to the current year on a fractional basis.)
Under Internal Revenue Code (IRC) Sec. 7701(b), Definition of Resident Alien and Nonresident alien, arises Form 1040NR, U.S. Nonresident Alien Income Tax Return, which is the tax form used by nonresident aliens to file their individual U.S. income taxes.
Some options for getting out of U.S. tax residency include: the Closer Connection Exception available on Form 8840 (Closer Connection Exception Statement) and U.S. federally negotiated income tax treaties.
Some ways to override U.S. Social Security taxes include: Social security treaties and Totalization Agreements.
For U.S. state tax purposes the requirements can be quite different and vary from state to state. Typically, there are state-specific facts and circumstances domicile tests. This is in addition to statutory resident tests, the main purpose of which is to catch individuals claiming a foreign state as their state of domicile. These statutory resident tests are typically conjoined with 183 days of presence rule and a permanent place of abode pretext, the latter of which is state specific, subjective and/ or vague.