(a) A certificate of occupancy issued by the building inspector is required in advance of the occupancy or use of: (1) Any building, structure, land, or premises; (2) Any building, or structure hereafter erected or moved; (3) Any building hereafter altered, so as to affect the front, side, or rear yards thereof, or its height; (4) Any nonresidential building, structure, or premises in which there is a change of occupancy or use; (5) Each nonconforming use created by the passage of and subsequent amendments to the ordinance from which this chapter is derived. Such nonconforming use shall obtain a certificate of occupancy within 30 days of the date of said passage or amendments. (b) Within three days after the application for a certificate of occupancy and payment of any required fees, the building inspector shall sign and issue a certificate of occupancy if the proposed use of land or building, as stated on the certificate of occupancy and signed by the owner or his appointed agent, is found to conform to the applicable provisions of this chapter, and if the building, as finally constructed, complies with the plans submitted for the building permit.