Make sure that the Mouse calibration hack is checked when you start. Once you have calibrated the light gun, alt/tab to bring up the main pcsx2 screen and uncheck the mouse calibration hack box. If you don’t do that, it wont register all of your shots.
The most important tip to get it working is to make sure that the light gun is calibrated correctly in windows. Stand exactly where you did to calibrate the gun.
I find it helpful to do the initial in game calibration with the mouse pointer on then turn it off once you start playing. Unfortunately, there is always a chance that it will drift off so you want to remove as many variables as possible.