Whenever he gets nervous he wants to go to the bathroom.
Tips
usage
上厕所 is the most direct, everyday phrasing for needing the toilet. Using 上 ('go up to') with places like 厕所 / 洗手间 is fossilized: native speakers overwhelmingly prefer 上. For polite register: 上洗手间. For extra-polite/evasive: 方便一下.