I have viewed hundreds of photographs of people who died by hanging, almost all of them visibly pee themselves so it's almost a garantee. But it could be that most of them didn't know this will happen, so they didn't think it was necessary to go to the bathroom directly before they hang themselves. You can go to the bathroom directly before hanging yourself to minimize the urine you're about to release and wear black clothes so it's less obvious. This is something that typically happens in death, because your body won't put effort into holding your urine in anymore, peeing while trying to hang yourself can happen sometimes, but peeing yourself while hanging is something that usually happens in death and not before.