Hi,
Yes, you simply first try to join a random room ( room already created should only allow 2 players, and so random join would only join rooms with a missing player).
and if the join random fails, you create a room.
that's it. the rest is pure UX, meaning you need to show this in a intuitive form. for example, creating a room doesn't have to make the player leave the menu and join the game scene straight away, you could keep the user in the menu, with an indication that he's currently waiting for another player to join.
Does that make sense?
Bye,
Jean