Creating rooms

How to implement a rooms with two users and if one room is full then another room is created? How can I set this up with MediaSoup.