If the undergraduate major is a non-mathematics major, and the math teacher in primary and secondary schools suggests that you can choose to take the master's degree in education first, and then take the math teacher's qualification certificate in primary and secondary schools!
I hope it helps you!