The convoluted techincal logicistics of why it’s not gay and precisely when it does become so is silly. The answer is that yes, doing sexual acts with someone of the same sex/gender meets the common definition of being gay. But gay and straight are just words used to self identify. Humans are way dynamic than trying to cling to these arbitrary labels. Having a threesome has zero impact on you telling a potential partner that you are gay/straight because you’re interested in them.
Labels are important and helpful, but we gotta remember they are just words that can’t define the sum of a human not accurately catch the essential essence of any single person. So it’s healthy to recognize their limitations, trying to precisely define what is and isn’t gay just feels like cope so you can keep calling yourself straight. Just do it, this doesn’t matter.