@Dominions Son
This would generally fall under either indecent exposure or public indecency.
Well, the only place such terms are ever mentioned in my jurisdiction is in municipal rules (which may differ by city, town or village) where such is routinely listed as one of behaviors that can potentially constitute case of hooliganism, if it disrupts public order in dangerous ways or significantly preclude others to use the place for its intended purpose (usually upon discretion of law enforcement).
The other alternative is if someone is offended enough to elevate it to a case of sexual assault under criminal law, with all the potential consequences like sex offenders register.
So here, basically, nudity in itself isn't illegal anywhere. If you're in urban area and a cop ask you to cover up, then better do, or else you may be arrested for hooliganism. But being caught intentionally exposing male genitals in front of a school in session will land you in sex offenders register; there was at least one case to that effect not long ago (two years ago I think). But that's based on perceived intentions and exact actions, not the exposure as a fact. Simply walking by naked may or may not in fact make much fuss. He more likely made very deliberate show of himself.
(Yes, I specifically said male genitals, because traditional public opinion around here is that only men can ever commit sexual assault by mere exposure, as male genitals are unconditionally offending, while women are supposedly harmed by their nudity being observed, but otherwise artful beauty.)