No, that's not true. As I said, that depends on where you live. For example, in Ireland, for children born outside of marriage, only the mother has an automatic right to guardianship. The same is true in the UK unless the father is added to the birth certificate. The same is true in most US States - no automatic parental rights without marriage.