ويجب الغسل بالإيلاج في كل فرج قبل أو دبر من آدمي أو بهيمة حي أو ميت لأنه فرج أشبه قبل المرأة فإن أولج في قبل الخنثى المشكل فلا غسل عليهما لأنه لا يتيقن كونه فرجاً فلا يجب الغسل بالشك
الكافي في فقه الإمام أحمد بن حنبل لإبن قدامة كتاب الطهارة باب ما يوجب الغسل
And washing [ghusl] is made obligatory by penetration of any opening, front or rear, human or animal, alive or dead, because it is an opening that resembles the front part of a woman. And if a man penetrates the front part of an ambiguous hermaphrodite, they are not obliged to wash, since its constitution can not be ascertained as a vagina; washing is not made obligatory based on uncertainty.
Ibn Qudama, Al-kafi fi Fiqh Al-imam Ahmad ibn Hanbal [Sufficiency in the Jurisprudence of Imam Ahmad ibn Hanbal], The book of purity, Section: that which necessitates washing