(b) For any taxable year beginning after December 31, 1966 (computed without any reduction for distributions), shall not include the excess of any item includible in gross income of the foreign corporation under section 882(b)(2) as income effectively connected for that year with the conduct by such corporation of a trade or business in the United States, whether derived from sources within or from sources without the United States, Over any deductions allocable to such item under section 882(c). However, if the sale or exchange of stock in the foreign corporation by the United States person occurs before January 1, 1967, the provisions of (a) of this subdivision apply with respect to such sale or exchange even though the taxable year begins after December 31, 1966. See section 1248(d)(4). Any item which is required to be excluded from gross income, or which is taxed at a reduced rate, under an applicable treaty obligation of the United States shall not be excluded under this subdivision from earnings and profits accumulated for a taxable year (computed without any reduction for distributions).