Step 1: Add your users into respective groups.
Step 2: After that create "grouping" and assign groups into grouping.
Step 3: create activity in course, go to "Group submission settings". set Yes to Students submit in groups and Require group to make submission. Go to Common module settings and then choose your desire group for "Grouping" .
Hope this resolves your issue.
(Edited by Mary Cooch to correct docs link - original submission Tuesday, 17 January 2017, 10:43 AM)