Living space is an important place for primary and secondary school students to grow and study, and its influence on primary and secondary school students in terms of layout and color design has gradually become a hot research topic. In this paper, the mental health level of primary and secondary school students is taken as the explanatory variable, and the living style and living environment are taken as the core explanatory variables. A multiple linear regression prediction model is introduced to explore the linear relationship between multiple variables. A total of 7,063 valid data sources were obtained by distributing questionnaires online. The overall study motivation of the sample was statistically analyzed, and the multiple linear regression prediction model was further used to analyze the correlation between living space design and study motivation. The research samples were selected and the proposed predictive model was used to conduct regression analysis of multiple variables with the mental health status of primary and secondary school students. Among them, P<0.05 was found between the living space design and the learning motivation and mental health status of primary and secondary school students, indicating that a reasonable living space design can have a positive impact on the learning motivation and even the development of mental health of primary and secondary school students.