As a solo you have to pick two roles.
As a duo if you could each pick the same roles, you'd effectively each guarantee yourself a role.
That's sort of unfair to solos isn't it? You're guaranteed top and mid, while the guys queued mid/adc or top/jg may get an off role. You get mid for sure and your duo gets top for sure.
So basically, #of roles to queue for = # of players queuing + 1.
2 players = 3 roles to queue for.
3 players = 4 roles to queue for.
--> however it gets tricky here, as you can queue top/mid, mid/top, and adc/jg let's say. So two people can guarantee their roles if the third is completely different.
4 players = must have fill or all 5 roles. I think. It may just require someone queues support (I've heard this - never queued as 4).
5 players = do w/e you want