Homosexuality has been illegal in Uganda since the time of British colonial rule, and in theory can result in a sentence of up to 14 years in prison. Not satisfied with this relative lenience, in 2014 the Ugandan government passed legislation that punished homosexuality with life imprisonment (watered down from the death sentence proposed by the original law), but this draconian measure was thrown out by the Constitutional Court.
As you might expect, the gay community here remains very much underground. LGBTQI tourists are advised to likewise keep things discreet, although there’s no need to be overly worried as foreigners are rarely the subject of investigation. Some lodgings will refuse to put two people of the same sex in a one-bed room.