What his mother told you is not accurate as a general rule, and you should not take her word for it without verifying directly with the facility.
Visitation policies vary by institution, but restricting visits to legally married spouses and blood relatives only is not standard practice at most prisons and jails in this country. Facilities typically allow approved visitors who pass a background check, regardless of whether they are family by blood or marriage. Being a girlfriend, a fiancée, or the mother of an inmate's child does not automatically disqualify you.
The fact that you share a child with him is actually a strong argument in your favor. A facility blocking the mother of an inmate's child from visiting while allowing the child to attend with other family members would be unusual and worth challenging directly.
Call the facility and ask to speak with a counselor or case manager. Explain your relationship and ask specifically what the visitation policy is and what you need to do to get approved. Get the information straight from the source rather than secondhand from someone who may have her own reasons for discouraging your visit.
If the counselor cannot give you a clear answer or you hit a wall, call the warden's office directly and explain the situation. That call tends to produce results when the standard channels do not.
Fill out the visitor application, go through the approval process, and let the facility make the actual determination. Do not let anyone else make that call for you.