Section 2. No person shall act as a mortgage broker or mortgage lender with respect to residential property unless first obtaining a license from the commissioner; provided, however, that any person who is employed by or associated with a licensed mortgage broker or mortgage lender in the capacity of a mortgage broker or mortgage lender under the direction of said licensed mortgage broker or mortgage lender shall not be required to obtain such license. The provisions of this chapter shall not apply to any mortgage lender making fewer than five mortgage loans within any period of twelve consecutive months; provided, however, that in computing the number of mortgage loans, there shall be counted in the loans of more than one partnership, association, trust or corporation, the majority interest of which are owned or controlled directly or indirectly by the same person or persons, partnerships, associations, trusts or corporations and including in the loans of a partnership or company not incorporated the loans of the several members thereof. The provisions of this chapter shall not apply to any person who acts as a mortgage broker fewer than five times within any period of twelve consecutive months. The provisions of this chapter shall not apply to a bank as defined in section one of chapter one hundred and sixty-seven, a national banking association, a federally chartered credit union, a federal savings and loan association, a federal savings bank, or any subsidiary or affiliate of the above, insurance company, or to any bank, trust company, savings bank, savings and loan association, credit union or insurance company organized under the laws of any other state; provided, however, that except as provided herein, such provisions shall apply to any subsidiary or affiliate, as defined by the commissioner, of any such exempted entity and of a bank holding company established in accordance with state or federal law; and provided, further, that such provisions shall not apply to any instrumentality created by the United States or any state or to any nonprofit, public or independent post-secondary educational institution within the commonwealth authorized by law to grant degrees by the commonwealth, or by any agency or instrumentality thereof, for mortgage loans made by any such educational institution to its faculty or staff, or to any charitable organization originally created by a last will and testament before January first, nineteen hundred and fifty which makes no more than twelve mortgage loans during a twelve month period or to a real estate broker or real estate salesman as defined in section eighty-seven PP of chapter one hundred and twelve who, in connection with services performed in a prospective real estate transaction, provides mortgage information or assistance to a buyer if such real estate broker or real estate salesman is not compensated for the same in addition to the compensation received from the seller for such real estate services. The commissioner may adopt, amend or repeal rules and regulations, which may include an adequate capitalization requirement for mortgage lenders, to aid in the administration and enforcement of this chapter.