The match maker builds team as follows.
2 Supports role locked, 1 main tank role locked, 1 off tank unlocked, 2 dps unlocked.
So you have a 2/2/2 build but you still have 3 players able to flex so you can play anything viable except quad dps, which is not viable and probably never should be.
Players queue up as their prefered role as priority 1 and can (optional) set another secondary role as priority 2.
To avoid long queue times the match maker will give you your secondary role, if he cant find a quick match with your first priority.
However, you will get a higher priority to get your prefered role next game as a reward. The match maker will place you first as your prefered role over those who compete with you for the same role, but had their prefered role last game.
So you will end up in a first priority, second priority rotation in case you play an overpopulated role, which will probably be dps.
Thoughts?
Edit: New addition
You will be able to send role slot exchange requests to teammates between rounds.
If both players agree they swap slots. This opens up the option for exampel, if you have a main tank who play mainly Reinhardt, but is terrible on Winston, but the next map favors Winston heavily over Reinhardt, to swap slots.
That way another teammate who is good at Winstons can swap to the main tank slot, while the old main tank gets the role of the new Winston player.