First you need a group to join. Type something like this in the group leader's init field..
GroupA = group this
Now his group will be GroupA. To have a unit join this group, use this.
[unitname] join GroupA
You can also add multiple units at once like this.
[unit1, unit2, unit3] join GroupA
The tricky thing is, you have to use brackets [] even with a single unit. The 'join' function will give you an error if you pass it anything besides an array.
To make one group join another, you can also use something like this.
(units GroupB) join GroupA
The 'units' function always returns an array of the group's members, so it's safe to use.