There are several ways you could potentially achieve this particular end. The immediate obvious way would be to have two User subsets. One for Group A, and another for Group B.
Then arrange all of your Elements/Fields onto your page, then add a visibility Subset to the elements.
You could achieve a similar result using Dependencies, but the subset option is probably the better of the two options.
If you so wished, you could also group all of the Fields needed for Group A into a single widget and likewise for Group B, and simply add a User Visibility Subset to the entire widget to restrict the view to either Group A or Group B.
I hope I haven’t over simplified what you are trying to achieve. Please elaborate further if you feel I have and I will look at this some more for you.
Regards - Mark P