invite 12 person from 24 that we have 6 men and 6 womens
Say the man invites 2 of his male friends so he has to invite 4 female friends to get to a total of 6. The female fills the gaps - she invites 4 male friends and 2 females. Now the guy has C(5,4) options to invite female friends and C(7,2) for his male friends in this example. The female has C(7,2) for the female part and C(5,4) for the male part.

Now you sum over all variants: