I can answer this question as the law applies in the jurisdiction where I practice divorce and family law (Utah), and you may find my answer useful in conducting the research to find the answer to this question as it applies in your jurisdiction, but you will need to consult a knowledgeable divorce and family law attorney in your jurisdiction to get the answer as it applies in your jurisdiction.
The parent-child relationship is legally established in Utah the following ways:
Utah Code § 78B-15-201. Establishment of parent-child relationship.
(1) (a) The mother-child relationship is established between a woman and a child by:
(i) the woman’s having given birth to the child, except as otherwise provided in Part 8, Gestational Agreement;
(ii) an adjudication of the woman’s maternity;
(iii) adoption of the child by the woman;
(iv) an adjudication confirming the woman as a parent of a child born to a gestational mother if the agreement was validated under Part 8, Gestational Agreement, or is enforceable under other law; or
(v) an unrebutted presumption of maternity of the child established in the same manner as under Section 78B-15-204.
(b) In this chapter, the presumption of maternity shall be treated the same as a presumption of paternity as established in Subsection 78B-15-201(2)(a).
(2) The father-child relationship is established between a man and a child by:
(a) an unrebutted presumption of the man’s paternity of the child under Section 78B-15-204;
(b) an effective declaration of paternity by the man under Part 3, Voluntary Declaration of Paternity Act, unless the declaration has been rescinded or successfully challenged;
(c) an adjudication of the man’s paternity;
(d) adoption of the child by the man;
(e) the man having consented to assisted reproduction by a woman under Part 7, Assisted Reproduction, which resulted in the birth of the child; or
(f) an adjudication confirming the man as a parent of a child born to a gestational mother if the agreement was validated under Part 8, Gestational Agreement, or is enforceable under other law.
An unmarried father has no parental rights unless and until he establishes paternity. In Utah, paternity can be established three different ways: Voluntary Declaration of Paternity, administrative paternity order, or a judicial paternity order. These are explained in more detail here: https://www.utcourts.gov/en/about/miscellaneous/mediation/cpm/paternity.html
Utah Code § 78B-15-305(1) provides:
(1) Except as otherwise provided in Sections 78B-15-306 and 78B-15-307, a valid declaration of paternity filed with the Office of Vital Records is equivalent to a legal finding of paternity of a child and confers upon the declarant father all of the rights and duties of a parent.
Some assert that in Utah, as to a child born to unmarried parents, the mother has sole legal and physical custody of the child until a court orders otherwise, but I cannot find any legal authority for that proposition. It appears to me that once paternity of a child is legally established that a father has the same parental rights as to that child as does the mother.
Utah Family Law, LC | divorceutah.com | 801-466-9277
(16) Eric Johnson’s answer to Who has custody of a child if there is no court order? – Quora