How to achieve a people selection module

Maybe this can help you. One detail is that in that form only one person is selected, and you need to select two. If you do 2 randoms, there is a chance you get the same number,