A comfortable indoor environment plays an important role in improving students' learning efficiency and health. How to optimize the design of primary and secondary school education buildings to achieve a comfortable indoor environment, considering both energy and cost is a considerable challenge. This paper proposes a two-stage multi-objective optimization method based on a meta-model to obtain the optimal design scheme for primary and secondary school education buildings, based on daylighting, thermal comfort, energy savings and economy. The method has two stages: building envelope optimization and building generation system optimization. In the stage of building envelope optimization, an artificial neural network (ANN) model coupling optimization algorithm is used to optimize the building envelope. The performances of the non-dominated sorting genetic algorithm II (NSGA-II) and multi-objective particle swarm optimization (MOPSO) algorithm are compared in the optimization process. In the stage of building generation system optimization, the design optimization of the building photovoltaic generation system is studied. Finally, the effectiveness of the two-stage optimization method is verified by a typical teaching building in Nanjing. The results show that the optimal scheme set of building envelope design can be obtained by this optimization method, and the optimal tilt angle and azimuth angle of the photovoltaic generation system are 30° and 210°, respectively. The minimum payback periods of the photovoltaic generation system are 11.75 years and 9.32 years under the policy of selling electricity that is not permitted and selling electricity that is permitted, respectively.