A certificate of occupancy shall be required in advance of occupancy or use of: (1) A building hereafter erected; (2) A building hereafter altered so as to affect height, or side, front or rear yards; (3) A change of type of occupancy or use of any building on premises.