The general rule is that if a child is born out of wedlock the Mother is the only legal guardian of the child until a court decides otherwise.  A couple can also enter in to a custody agreement which the court can put their approval to.  Good luck.