“In a situation where the parents have been living together since prior to the child’s birth but have never been legally married, who is considered to have primary custody of the child, and can one parent take the child and leave without a formal custody agreement?”
In both a marriage, and the instance of an unmarried family where the father has been legally acknowledged as the father, either through DNA testing, a paternity action or, if your state’s laws provide, by being listed on the birth certificate, both parents are equally entitled to having the child with them, and neither parent would be legally in the wrong for leaving with the child – after all, in the case of a split, the child has to be somewhere. If there has been no legal acknowledgement of paternity, than the mother could take off with the child, but she shouldn’t. In all cases, it is paramount to the child’s best interest that amicable, or at least cooperative, co-parenting arrangements be put into place at the outset.
Finally, “primary custody” in this context is a legal construct which, by definition, must be awarded by the court. No parent has primary custody unless and until it is awarded to them by the court.