In the child contract, one party (NPC or PC) is named as the "owner" of the child. So, you can make a child contract with another player and before signing the contract, figure out who is going to have custody of the resulting child. For married players, everything they own (including children) are considered shared, so you don't run into that issue. Likewise, once player 1 male and player 1 female have the baby, because player 1 male is married to player 2 male and player 1 male has custody of the child, player 2 male also has custody of the child.
Hope that helps.