The sexual relationship between two men is called “Liwat” and its rulings and punishments have been explained elsewhere.
From the Islamic point of view, each person can only have a sexual relationship with a person from the opposite sex through conducting a marriage contract with its appropriate conditions that are mentioned in its place, and having any sexual relationship with a person of the same sex, whether it is a man or a woman  , is prohibited.
As for having an earring, we must say that: If earrings are only used by women in a society, then it is prohibited for men to use them for beauty purposes.  But does wearing an earring prove one to be a homosexual or not? Once again, we cannot say that such a thing is true at all times, because such a thing may be perceived as a sign of homosexuality according to the customs of a certain society. However, we are not allowed to accuse someone of being a homosexual because of having an earring, and if we need to know about someone, we should do more research about him.
Having a homosexual relationship is a very egregious sin, but one can still repent and return to the right lifestyle by getting married in accordance with religion.
In all events, if he/she does not repent and is found guilty in court, men who have committed Liwat (anal intercourse) and women who have committed scissoring (a form of tribadism; in Islamic terms, “Sohq”) will be punished by the Hadd (Punishment) of Liwat and Sohq, and if their relationship has not reached Liwat and Sohq and they have engaged in acts less than that, they will be punished by Ta’zir (A punishment that is set by the Islamic leader).
For more information you can refer to:
4- Masturbating and Gender Change, Question 3011 (website: 3272).
5- Islam and Healthy Relationships Between Boys and Girls, Question 1044 (website: 1110).
 Also Sohq, or Musahaghah means the act of two women pleasuring each other through scissoring. If four just individuals bear witness that: “We saw that one of them placed her vulva on hers” each one of them will be whipped a hundred times and if they repeat this act for three times, the fourth time they will be put to death. If they repent before they are found guilty for the act of Sohgh or Liwat, their Hadd (punishment) will be forgiven, while if they repent after they are found guilty their Hadd will not be forgiven. Also if two nude women that are not related sleep together, they will be punished by Ta’zir and after Ta’zir is carried out two times, for the third time they will be punished with Hadd. The Hadd of Sohq is less harsh than the Hadd of Liwat or Zina (Adultery). See: Maqalaat Fiqhiyyah, pg. 260; Fiqh al-Imam al-Sadiq, vol. 6, pg. 269; Mabani Tahrir al-Wasilah, vol. 2, pg. 385; Allamah Hilli, Tarjomeh va Sharhe Tabsiratul-Muta’allemin fi Ahkam al-Din, vol. 2 pg. 737.
 Tawdih al-Masa’el (annotated by Imam Khomeini), vol. 1, pg. 468.