What rights does a father have in custody of child?

If the parents are married they have equal rights. If not married, the mother in general have sole custody in most states until the father have established his paternity. When he has done that by DNA test he can petition for custody and visitation in court.