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.

// write this code before join room and create room class

function getMediasoupWorker() {
const worker = workers[nextMediasoupWorkerIdx]

if (++nextMediasoupWorkerIdx === workers.length) nextMediasoupWorkerIdx = 0

return worker
}
let worker = await getMediasoupWorker()

// write this code in room class
worker
.createRouter({
mediaCodecs
})
.then(
function (router) {
this.router = router
}.bind(this)
)