Definition from Nolo’s Plain-English Law Dictionary
Anal copulation by a man inserting his penis in the anus either of another man or a woman. If accomplished by force, without consent, or with someone incapable of consent, sodomy is a felony in all states in the same way that rape is. Homosexual (male to male) consensual sodomy between consenting adults has traditionally been a felony, but increasingly is either decriminalized or seldom prosecuted. Sodomy with a consenting adult female is virtually never prosecuted even in those states in which it remains on the books as a criminal offense.