When you add a teacher (from "Staff management"> "Add user") you can select several groups / classes. Just select the respective classes where it says "Group".
If you want to associate a teacher already added to the school to several classes, go to "Staff management" and click on "Teachers".
Search for the teacher in the list or use the search box at the top right. Click on "Actions"> "Edit" next to the teacher you want to make the change to.
In the next screen click on the empty space under "Group" and select the classes to be associated with. Click again to add another class. Click "Save" at the end to save the changes.
To delete a class from the list of associated Group, click that "X" next to a class name and click "Save" to save the changes.
Go to "Children Groups" and click on the name of the group you want to associate the teacher with. On the right you will see an "Assign teacher" button, to assign a teacher click on that button and click on "Assign" next to the teacher you want to associate.
Also from this section you can exclude a teacher from that group. On the right side where the teachers are listed, click on the red "Exclude" button next to a teacher to exclude him from the group.