Sodomy is a term for anal sex: the kind of sex where a penis goes into an anus.
Sodomy is a term for anal sex that is not neutral: it implies a point of view. Most often, sodomy is mentioned in religious and legal contexts, which have at various times insisted that anal sex is either a sin or illegal. Usually, someone with a positive view of anal sex won't call it sodomy. A medical term for sodomy is anal intercourse; a slang term is buggery.