People made a mention of washing because of sexual defilement before the Messenger of Allah (May peace be upon him). The Messenger of Allah (May peace be upon him) said: I pour (water) on my head three times. And he made a sign with both his hands.
عَنْ جُبَيْرِ بْنِ مُطْعِمٍ أَنَّهُمْ ذَكَرُوا عِنْدَ رَسُولِ اللَّهِ ﷺ الْغُسْلَ مِنَ الْجَنَابَةِ فَقَالَ رَسُولُ اللَّهِ ﷺ أَمَّا أَنَا فَأُفِيضُ عَلَى رَأْسِي ثَلاَثًا وَأَشَارَ بِيَدَيْهِ كِلْتَيْهِمَا