Same sex mating, like in the picture below, has been studied pretty intensely in bed bugs, but also in the Fruit fly Drosophila.
So let's talk a little bit about Fruitless!
#DeepDive
There's no equivalent in humans, so there's not really a way to make comparisons.
In fruit flies, it's the ratio between the sex chromosomes and the non-sex chromosomes which is important. 1:1 sex:nonsex is female; 1:2 sex:nonsex is male.
It's...a bit wonky.
The Fru mutation-which has been snipped and driven using a genetic driver (LexA)-results in a lot of male/male courting.
However...most of the studies which produced this data raised the flies in isolation.
This gene is called Doublesex, and it's also sex-specifically spliced by Transformer.
However...there's a problem. Unlike Fruitless, Doublesex is made in all parts of the fly.
There's a driver called c155 which we can use to cause the brains of the male flies to express massive amounts of the female-specific transformer protein in a brain-specific way.
Whether Fruitless mutants court males, or court indiscriminately, depends on their social environment while learning how to court.
It's a long road to using this knowledge to disrupt mating in-say, disease vectors, but we now understand the process a lot better.