This is a really interesting and provocative question, especially in how it considers an intersection between gender, sexuality, and race.
I can't speak to the situation in Africa, so all of this is with reference to North America.
Firstly, we have to consider that notions of "homosexuality" are socially constructed. We operate within that framework because in Western society, historically and contemporarily, we reproduce for each other the idea that gender is a binary (man/woman) and that sexuality is similar, though maybe with a bit more fluidity. However, for Indigenous societies in North America, the way gender was configured was quite distinct. Though sometimes it might have looked like our own binary system, we also have to remember that Indigenous cultures across the continent differed greatly, so attitudes towards non-normative genders and sexualities would also (and continue to) be very context-specific. Here's a good primer on the social construction of gender and sexuality: Kevin P. Murphy and Jennifer M. Spear, eds., Historicizing Gender and Sexuality (Malden, MA: Wiley-Blackwell, 2011).
So, once we have that background established, then we can look for specific examples of non-normative sexual identities in Indigenous North America. There are lots of great resources on this! I'll make a list below. Generally, though, what it demonstrates is that in some communities, the presence of three or even four genders really complicates our understandings of whether we can call these historical Indigenous people "homosexual."
For example, sometimes women took on male roles, and even hunted and fought along side men, and in even more rare cases, actually became important leaders in their communities. So that is a conflation of our own gender norms, especially if the community had an understanding that these people were neither "men" nor "women" but, rather, a differently-gendered person. If the same female-presenting, differently-gendered person, who is already not behaving in a way that Western society would recognize as feminine, is intimate with a woman, we can see that in our system, this might be understood as a homosexual act. However, since the understandings of gender in the past were different than ours, are we accurate in referring to women like these as "homosexuals"? Many today, Will Roscoe among them, would argue, no. He calls them "two-spirited", though they were historically referred to as "berdaches." Further, he presents the idea that people who occupied third and fourth genders and experienced non-normative sexualities were quite common in Indigenous societies.
Of course, the Christian perspectives on homosexuality that missionaries and colonial agents introduce to Indigenous communities mean that both these different genders and alternative sexualities are increasingly limited after colonization.
Other reading:
Boag, Peter. Same sex affairs: constructing and controlling homosexuality in the Pacific Northwest. Berkley: University of California Press, 2003.
Roscoe, Will. The Changing Ones: Third and fourth genders in Native North America. New York: St Martin's Press, 2000.
Slater, Sandra and Fay Yarbrough, eds. Gender and sexuality in Indigenous North America, 1450-1800. Columbia, SC: University of South Carolina Press, 2011.
Here's but one source to check out- "Heterosexual Africa?: The History of an Idea from the Age of Exploration to the Age of AIDS" by Marc Epprecht.
According to the publisher's description: "Epprecht argues that Africans, just like people all over the world, have always had a range of sexualities and sexual identities. Over the course of the last two centuries, however, African societies south of the Sahara have come to be viewed as singularly heterosexual. Epprecht carefully traces the many routes by which this singularity, this heteronormativity, became a dominant culture."