I'm pretty sure its always been a thing, its just a long time ago there was a no homosexuality policy almost everywhere, punishment was normally death. People would stay in the closet for their lives. Even after homosexuality was allowed by law, it was still strictly taboo. Now that people are starting to open up, and Pro-LGBT+ movements and stuff are happening, things are starting to change for the better I know I didn't cover everything, so add as you wish...
It's always existed, with the first documented couple being Khnumhotep and Niankhkhnum during the 25th century BC. I may be wrong, but it never became a negative thing until the rise of Christianity and the Abrahamic faiths.
It has always existed, even before humans (and it continues to exist in other animals). In humans, the story of homosexuality is also extremely old. In ancient Greece, as AuroraBorealis said, it wasn't hidden most of the time. In fact, in some regions and cultures, the homosexual sex was practiced by most men (including men that would be considered "heterosexual"), as a sign of power and/or deep bound. It is also interesting to note that, in ancient cultures, we already had some prejudice towards the receptive partner, as some cultures considered that "being a bottom" was a "woman position", and women were viewed as inferior (unfortunately, we still have that problem nowadays, with prejudice outside and inside the LGBT community towards the receptive partners). If you search about this in Google Scholar, you will find studies that discuss this. It is worth a shot.
Always been around, often accepted in cultures untouched by the prejudices of Abrahamic religion. Should be noted, however, that in some cases homosexual relationships between men were often seen as entirely for pleasure, while heterosexual relationships were love and procreation. It would seem within the last few centuries the idea that homosexuals can have stable, happy marriages without the need for a mate of the opposite sex. Anyone here know that around the early 20th century the term "homophile" was put forward by early LGBT members, rather than the term "homosexual", to place more emphasis on love rather than sex?