Brain doesn't matter.Popping pills won't change the thing that matters most....
Men are born with a Y chromosome, women with another X chromosome.This is what determines gender.
XX = female, XY = male.
Actually, it's not that simple for many people.
It's like saying "you have blue or brown eyes." Well, yes, those are the genes, but there are also other modifiers that give people, green, hazel, lavender, grey, pink, and some are two colour and heterochromic - sometimes cause by chimerism where people can contain to completely separate DNA strains from different people are in one body.
There are XXXY people, and other sorts of 'intersex' combinations. Some x's are incomplete - so they are sort of between and X and a Y.
So when you study something as complex as DNA and even more complex human personality and sexuality - it's easy to see how some people end up somewhere in the middle of the spectrum.