My knowledge in this area has a lot of holes in it, but this is what I understand. The prenatal testosterone levels are generally determined by the genetics of the child and produced by the child's body. However, there are other factors, which can change the sensitivity to these base testosterone levels. In this case, I am not sure if premature birth will necessarily affect the brain development as the child will still produce these levels.

There may be a build in mechanism in woman affecting the sensitivity to prenatal testosterone in males based on male birth order. First born males for instance will develop as if the testosterone was at a lower level than their genetic testosterone level. Later born males will be affected to a greater extent by their genetic testosterone level. This does not appear to affect females and female births do not seem to affect the levels in later born males. In other words, earlier born males will be shifted more towards the more typically female brain side. I do not know if this is the case for the entire human population or just a subset.

Another interesting side note is something I learned from some of my daughter's mom's relatives about their tribal customs. They actually have a tribal role selection process based on male birth order. Found this interesting given what I know from the scientific information I have read about male birth order. Wonder if they noticed the pattern and incorporated it into their customs.

Certain drugs have been known to affect the sensitivity to prenatal hormone levels. A good example of this is in the case of DES babies. As many as one percent of the US/Canada population may have been affected by the use of this drug meant to alleviate morning sickness. It is known as the worst drug disaster in Canadian history. A lot of the plastics used currently have a chemical makeup which is suspected to have the potential to affect human development in similar ways.

I believe post-natal testosterone levels also affect brain development later in life. It may even be the case estrogen levels play a part in this as well. Most of this is just stuff I have come across over the years, with this last part being some thoughts I have on this. I just consider this useful information to be aware of, but I always remain open to the idea of this not being correct or at least not entirely.