Even when not married, it is not a given or automatic that the mother receives full custody: while that is certainly most common, the courts look to what is in the child's best interest and could award custody to the father if the mother is, for example, a drug user, incarcerated, mentally unfit, etc. And that is what the courts will do once you are married, too--look to the child's best interest. The courts will look to who has been the child's primary caregiver, who the child is more closely bonded with, the mental/emotional/etc. stability of the parents, and make a custody decision based on what is best for the child.