I have a doubt that if someone looks a girl and then after that discharges or feels sweating in underwear so ghusl becomes mandatory for him?

If u discharge then ghusl is wajib