I wasnt sure whete to post this sorry

So i have a legal question, if a unmarried couple had kids together and also claimed paternity and all that... so by law who has custody to have the kids if they decided to separate? Mom or dad?