Each country has its own rules for becoming a teacher in the school system.
In general, in most states of the US, a teacher needs a four-year bachelor's degree in a teachable subject such as history and a two-year master's degree in education to get their teaching credential.
In fields with shortages such as math, many states allow a person with a bachelor's degree in the subject to get a restricted teaching credential.
For teachers from other countries, they can usually get a teaching credential if they can demonstrate a suitable level of English and that their education is equivalent to that required for a teaching credential. In reality, some teachers from other countries find it easier to simply get a master's in education and then apply for the teaching credential.