Wa `alaykum As-Salamu wa Rahmatullahi wa Barakatuh
In the Name of Allah, Most Gracious, Most Merciful.
All praise and thanks are due to Allah, and peace and blessings be upon His Messenger.
In this fatwa:
Answering your question, The Fatwa Center at Islamweb, states:
1) Anything that comes out of the front or back passages (the penis, vagina, and anus).
2) Loss of consciousness due to sleep, fainting, drunkenness, or insanity.
3) Touching the genitals directly with the palm of the hand or the fingers.
5) Apostasy from Islam.
Almighty Allah knows best.