Commonwealth countries gay rights
Stonewall tweeted a picture outlining the situation of gay rights in the Commonwealth Twitter

It's illegal to be gay in 42 out of 53 Commonwealth countries, according to Stonewall, a non-governmental organisation that promotes gay rights.

Stonewall tweeted a picture outlining the situation of gay rights in the 53 Commonwealth countries as the Games started in Glasgow.

Among the countries that have banned homosexuality, there are some that harshly persecute homosexuals and, in the worst cases, sentence them to death.

IBTimes UK has listed the top five worst Commonwealth countries for gay people.

Brunei

Brunei sparked global outcry after introducing sharia law last May.

According to the new set of rules, homosexuals - but also people who commit "crimes" such as adultery, abortion and blasphemy - will be subjected to whipping, amputations and being stoned to death.

Worldwide gay rights groups and prominent celebrities have retaliated to what they dubbed as "stone the gays law" by calling for a global boycott of the hotel chains owned by Sultan Hassanal Bolkiah.

Nigeria

The Same Sex Marriage (Prohibition) Bill 2013, signed into law by President Goodluck Jonathan in 2014, imposes prison sentences of up to 14 years on those found guilty of involvement in gay organisations. Gays who publicly demonstrate their sexuality can be jailed for 10 years.

Dozens of gay Nigerians have been arrested since the implementation of the bill, according to Amnesty International, which condemned the law and urged for its removal.

The bill could also bar people suffering from HIV from obtaining medical cures, Unaids (Joint United Nations Programme on HIV/AIDS) and the Global Fund to Fight Aids, Tuberculosis and Malaria warned.

Uganda

Ugandan president Yoweri Museveni passed an anti-homosexuality bill in February that sees life imprisonment for homosexual offences.

Museveni previously rejected the bill, saying there were other ways to "rescue" homosexuals from their "abnormality" and life imprisonment was not the right method.

But he changed his mind after consulting with a group of medical experts who claim "homosexuality is not genetic but a social behaviour".

Prior to the implementation of the anti-gay law, gay activist David Kato was murdered in 2011 after Ugandan weekly Rolling Stone pictured his face and that of another man on its cover under the headline "Hang Them!"

The subheading read: "We shall recruit 100,000 innocent kids by 2012: Homos" and "Parents now face heart-breaks as homos raid schools."

Malaysia

In Malaysia, gay people face imprisonment, corporal punishment and deportation.

According to Malaysian criminal code – which has not been changed since the colonial era – sodomy and oral sex, between heterosexuals and homosexuals, are punishable with fines, incarceration up to 20 years and corporal punishment.

In 1994, the government banned members from the lesbian, gay, bisexual and transgender (LGBT) community from appearing in the state-controlled media.

In the same year, approximately 7,000 people were arrested for engaging in "unislamic activities" such as homosexuality.

In 2001, the government announced it would deport any visiting foreign cabinet and minister if they were gay.

Cameroon

Section 347 of the Cameroonian penal code says: "Any person who has sexual relations with a person of the same sex shall be punished with a term of imprisonment of five years and a fine of between 20,000 and 200,000 francs [£25-£250]."

According to NGO Human Rights Watch, Cameroon brings more cases against people who are suspected to be gay than any other African country.

"Most cases are marked by grave human rights violations, including torture, forced confessions, denial of access to legal counsel, and discriminatory treatment by law enforcement and judicial officials," the rights group said.

In 2011, Roger Jean-Claude Mbede, 34, was sentenced to three years in jail after sending a text to a man reading: "I am very much in love with you".

Mdebe died earlier this year after he was denied medical treatments to cure his hernia.

According to Pink News, in 2011, two men were arrested on suspicion of homosexuality based entirely on the way they dressed and spoke.