In the NHL a shot on goal is when the puck would have gone in the net if there was no goalie/player there to stop it. Or to put it another way, just pretend there is nobody "in the net", meaning the empty net is just standing there. If the puck would have gone in the net, it is a shot on goal, if it would not have gone in the net, it is not a shot on goal.
Note: Deflections (off stick or body) also count as shots on goal, even though technically it isn't a "shot". For example it could deflect off some dudes head and go into the net, it would count as a shot on goal for that player.
Note 2: Shots on your OWN net, do not count as shots on goal.