This is not a right/wrong kind of thing. You'll have to discover what works for you.
Back in the day we taught to hold the gun like this:
This still works and is what I'm suggesting for you; elbows down and front hand a little closer to the magazine.
Some even taught to do it like this:
...with the support hand on the magazine well.
The current "operators" will tell you to hold the gun like this:
This hold gives a little more control over the muzzle and can even help control muzzle rise. However, try standing with your arm out in front of you for a minute. Most can't hold their arm out by itself that long. Add the rifle and you cut that time in half. So, this "arm forward" type of hold is good, but not easy and takes some strength that no new shooter has.
Just to confuse things more, here is how the long distance precision shooters do it:
See how he has his support elbow tucked in and resting on his torso? Then he's supporting the gun by placing the magazine in the palm of his hand. He's even leaning back a little. This is a good stance, but only for those really long shots where maximum precision is necessary. You won't ever see this outside of competition.
In the end only one thing matters; bullets going where you intend. If the bullets are going where you want them, whatever hold you're using is the correct one. Try some different holds and see what works for you. Just because a hold is comfortable doesn't mean it's the right hold. Sometimes you need to work through a little discomfort to learn what works for you.
Even so, comfort is a factor. If the hold you're using is causing pain in your shoulder, you won't be able to shoot well. Try the hold in the first picture. Then try the second one. If one is working better than the other, use the one that gives the best accuracy for you. Then, when some well meaning range commando tries to tell you you're doing it wrong, show him your target and ask to see his.

Then just grin when yours is better.