The sex of an individual is dependent on how their reproductive systems are set up to create different gametes. Penises and vaginas are secondary to sex determination, and intersex is a null / indeterminate rather than a third state.