There are multiple strategies for setting up groups
Setup a group enrollment key and allow students to choose groups when they enroll in your class. This works when you are using a self-enrollment key for student to access your course.
Manually enroll students into groups once they are enrolled in your course.
Use the “auto create groups” to allow Moodle to auto create groups once you have specified group size.
HINTS: Remember you may want to enroll yourself into each group. You will also want to view groups from a student perspective to see that you have your settings correct.
This video provides a good demonstration of how to create groups and manually place users into the specific groups within a course.