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. (Using translation from Abū Dāʾūd 239)
عَنْ جُبَيْرِ بْنِ مُطْعِمٍ أَنَّهُمْ ذَكَرُوا عِنْدَ النَّبِيِّ ﷺ الْغُسْلَ مِنَ الْجَنَابَةِ فَقَالَ رَسُولُ اللهِ ﷺ «أَمَّا أَنَا فَأُفِيضُ عَلَى رَأْسِي ثَلَاثًا وَأَشَارَ بِيَدَيْهِ كِلْتَيْهِمَا»