The partial pressure of the gas will be the total pressure minus the vapor pressure. 523.8-23.8=500mmHg. This makes sense due to the fact that the idea of partial pressures still works even with vapor pressure since vapor pressure is just the partial pressure of water vapor (23.8mmHg) in the container which is added to the partial pressure of hydrogen gas (500mmHg) to make a total pressure of 523.8mmHg.
I hope this helps. Let me know in the comments if anything is unclear.