In the case of a nonresident alien individual, except where the context clearly indicates otherwise, gross income includes only—
(1) gross income which is derived from sources within the United States and which is not effectively connected with the conduct of a trade or business within the United States, and
(2) gross income which is effectively connected with the conduct of a trade or business within the United States.
The following items shall not be included in gross income of a nonresident alien individual, and shall be exempt from taxation under this subtitle:
(1) Ships operated by certain nonresidents Gross income derived by an individual resident of a foreign country from the international operation of a ship or ships if such foreign country grants an equivalent exemption to individual residents of the United States.
(2) Aircraft operated by certain nonresidents Gross income derived by an individual resident of a foreign country from the international operation of aircraft if such foreign country grants an equivalent exemption to individual residents of the United States.
Compensation paid by a foreign employer to a nonresident alien individual for the period he is temporarily present in the United States as a nonimmigrant under subparagraph (F), (J), or (Q) of section 101(a)(15) of the Immigration and Nationality Act, as amended. For purposes of this paragraph, the term “foreign employer” means—
(A) a nonresident alien individual, foreign partnership, or foreign corporation, or
(B) an office or place of business maintained in a foreign country or in a possession of the United States by a domestic corporation, a domestic partnership, or an individual who is a citizen or resident of the United States.
(4) Certain bond income of residents of the Ryukyu Islands or the Trust Territory of the Pacific Islands Income derived by a nonresident alien individual from a series E or series H United States savings bond, if such individual acquired such bond while a resident of the Ryukyu Islands or the Trust Territory of the Pacific Islands.
(5) Income derived from wagering transactions in certain parimutuel pools Gross income derived by a nonresident alien individual from a legal wagering transaction initiated outside the United States in a parimutuel pool with respect to a live horse race or dog race in the United States.
(6) Certain rental income Income to which paragraphs (1) and (2) apply shall include income which is derived from the rental on a full or bareboat basis of a ship or ships or aircraft, as the case may be.
(7) Application to different types of transportation The Secretary may provide that this subsection be applied separately with respect to income from different types of transportation.
(8) Treatment of possessions To the extent provided in regulations, a possession of the United States shall be treated as a foreign country for purposes of this subsection.
(Aug. 16, 1954, ch. 736, 68A Stat. 280; Pub. L. 87–256, § 110(c), Sept. 21, 1961, 75 Stat. 536; Pub. L. 89–809, title I, § 103(b), Nov. 13, 1966, 80 Stat. 1550; Pub. L. 99–514, title XII, § 1212(c)(1), (2), Oct. 22, 1986, 100 Stat. 2538; Pub. L. 100–647, title I, § 1012(e)(2)(B), (5), (s)(2)(A), Nov. 10, 1988, 102 Stat. 3500, 3527; Pub. L. 101–239, title VII, § 7811(i)(8)(C), Dec. 19, 1989, 103 Stat. 2411; Pub. L. 103–296, title III, § 320(a)(2), Aug. 15, 1994, 108 Stat. 1535; Pub. L. 108–357, title IV, § 419(a), Oct. 22, 2004, 118 Stat. 1513.)