According to the United States tax code there are domestic and foreign taxpayers. Domestic taxpayers, which include United States citizens, resident aliens and domestic corporations, are generally taxed on their worldwide income. (§ 61.) By contrast, foreign taxpayers such as nonresident aliens and foreign corporations are generally only taxed on certain income sourced within or connected to the United States. (§§ 871, 881, and 882.) This makes the question of which individuals or entities are domestic and which are foreign very important. An alien will be treated as a resident of the United States if they are lawfully admitted to the United States under the green card test or they meet the requirements of the substantial presence test. (§ 7701(b)(1)(A).)