Well, it doesn't seem to have been stated whether there was a determination of paternity at birth. If the ex signed such an affidavit, it's NOT the case that he's just a random person. He's going to be the presumed father at this point and he has just as much custody right as the mother.