Abstract: Objective: To investigate the mental health of middle school students in the period of home-based learning for epidemic prevention in northern Guangdong Province, and to analyze the influence of family system on the mental health of middle school students in home-based learning, so as to provide reference for targeted mental health education and intervention in schools. Methods: a self-made survey of mental health of middle school students in home-based learning for epidemic prevention was compiled, involving 9 middle schools, A total of 7472 valid questionnaires were received from the school psychological teachers through random sampling. Results: (1) the overall score of mental health of middle school students was above average, but the individual difference was large. The score of boys was significantly higher than that of girls; The score of urban students is significantly higher than that of rural students. (2) family has a significant impact on students' mental health, in which parents' occupation, family integrity, family economy, family atmosphere and the number of family children have a significant impact on students' mental health.(3) Stepwise regression analysis showed that gender, grade, nationality and place of residence, family economy and atmosphere in the family environment system entered the regression equation, and the explanation degree for the mental health of middle school students was 11.6%. Conclusion: the mental health status of home school students in northern Guangdong is generally good, and the family has a significant impact on the mental health level of middle school students. Home schools should pay attention to the mental health of students with different family situations, and effectively play the role of family ecosystem interaction, strengthen interaction and communication with children, so as to improve the mental health level of students.