With the exception of unrelated business taxable income determined in accordance with 26 U.S.C. § 512, the tax imposed by Section 40-18-31 shall not apply to the organizations referred to in 26 U.S.C. § 501(a), and the following entities:
(1) Farmers and other mutual hail, cyclone, or fire insurance companies, mutual ditch or irrigation companies or like organizations of a purely local character, the income of which consists solely of assessments, dues, and fees collected from members for the sole purpose of meeting expenses;
(2) Farmers, fruit growers, or like associations organized and operated as sales agents for the purpose of marketing the products of members and turning back the proceeds of sales, less the necessary selling expenses, on the basis of quantity of produce furnished by them;
(3) Federal land banks and national farm loan associations as provided in 12 U.S.C. § 2055;
(4) All national banks and national banking associations and all corporations engaged in the business of banking and of conducting a financial business employing moneyed capital coming into competition with the business of national banks during and for the periods during which such national banks and corporations are subject to an excise tax imposed by this state on or with respect to their respective incomes;
(5) Building and loan associations, substantially all the business of which is confined to making loans to members and insurance companies upon which the statutes of Alabama impose a tax upon their premium income; and
(6) Counties, municipalities, municipal corporations, political subdivisions of the state, instrumentalities of counties, municipalities, municipal corporations, the State of Alabama, and corporations or associations owned solely by counties, municipalities or the State of Alabama.