I doubt that whether or not you're married has anything to do with custody. Custody is given to the parent with whom the child's best interests are met. In other words, whoever is best for the baby.
If the father claims paternity and the mother doesn't challenge it. i.e. she agrees he's the father then both have a right to have custody. The reason the police couldn't help your friend is that his father has equal rights to custody until there is a court order. Because he has equal rights this situation was not a kidnapping.
If you're concerned that his father will take and keep your baby I suggest that you file in domestic court for sole custody with visitation/parenting time for the father. He can respond with his own request for sole custody or shared custody. The judge orders a custody study conducted by a court social worker and then decides who will have custody and how the visitation will work.
It's usual that whoever has the baby at the time of filing to be awarded custody tho extenuating circumstances can change that. I suggest that may be why your friend's ex took their son. She should immediately file for custody before the father has had much time with the son.
If you think the father will contest your petition for custody, I suggest that you get an attorney who can help you present a case in favor of you.
You have extenuating circumstances. Your husband is the legal father in most if not all states.
I looked at your profile. Your case is more complicated. Even if you're not living together but are still married, your husband is automatically the legal father of your baby. You don't have to acknowledge that there is a different father.
I can't tell if you want to give your baby the birth father's last name or not. Legally, ou don't have to even list a father. I suggest that the birth father has no legal rights even if you put him on the birth certificate. He may be able to gain some rights by going to court. You really need to talk with a lawyer.
You can usually talk with an attorney for the first time without having to pay. It's called a get acquainted visit to see if the two of you can work together, if you have a case, if you can pay the fees, etc. Or you can go to Legal Aid. I urge you to get professional advice!
You must be feeling anxious and a call to an attorney will answer your questions and relieve your mind.