Welcome to the forum.
Imagine if you will, that you have your guitar plugged into a fuzz box, then to your amp. If you turn the gain all the way down on your fuzz box, it doesn't matter if your amp is on 11.
Each audio stage in your chain probably had a gain control. as well as the track that you recorded on in Sonar, the buss that the track was sent to, and the output from the bus to your audio device.
When you record, make sure to enable the meters on the track that you are recording to. Check the level to ensure that you have a good setting that nearly (but never) peaks in the red. This will probably involve adjusting the gain on your hd500x.
Check the levels on each point in your signal chain. Is your gain to the bus showing proper levels? Is the output level to the audio device showing proper levels? Your final stage (to the audio device) should peak just barely short of 0Db. Look at the lanes in Console View to see all of your signal chain at one place.
It gets more complicated when you start adding more tracks, but this should get you started.
Glen