In the first place, we must distinguish between the rules undertaken by Buddhist monks for their own conduct, and any guiding principles for lay people.
A bhikkhu, or fully-ordained monk in the Theravada tradition, has taken upon himself a set of 227 rules of conduct. The aim of all of these is to enable him to conduct himself in such a way as is most conducive to the attaining of Enlightenment. The rules are voluntarily undertaken, and if a monk feels unable to live up to them, he is free to leave the Order, which is considered much more honorable than hypocritically remaining in the robe while knowingly infringing the rule. There are four basic rules, infringement of which is termed Parajika or "Defeat," and involves irrevocable expulsion from the Order. The only one we are concerned with here is the first, which deals with sexual intercourse.
Complete sexual continence is considered an essential feature of the monastic life. Intercourse of a heterosexual or homosexual character is automatically a Parajika offense. A monk who performs such an act is considered to have expelled himself from the Order, and is no longer in communion with the other monks. Any acts of a sexually unbecoming nature falling short of intercourse result in suspension . . . . . . .