26 U.S. Code § 6013(g)
(g) Election to treat nonresident alien individual as resident of the United States
(1) In generalA nonresident alien individual with respect to whom this subsection is in effect for the taxable year shall be treated as a resident of the United States—