An organization operated for the primary purpose of carrying on a trade or business for profit shall not be exempt from taxation under section 501 on the ground that all of its profits are payable to one or more organizations exempt from taxation under section 501.
For purposes of this section, the term “trade or business” shall not include—
(1) the deriving of rents which would be excluded under section 512(b)(3), if section 512 applied to the organization,
(2) any trade or business in which substantially all the work in carrying on such trade or business is performed for the organization without compensation, or
(3) any trade or business which is the selling of merchandise, substantially all of which has been received by the organization as gifts or contributions.
(Aug. 16, 1954, ch. 736, 68A Stat. 166; Pub. L. 91–172, title I, § 121(b)(7), Dec. 30, 1969, 83 Stat. 542.)