(For the US)
Your upper arm should be parallel to the ground, your lower arm should be at ~45 degrees. The tip of the middle finger should touch the right-hand bill of your hat / cap where it joins the body of the hat / cap.
The hand should be rotated such that only the edge of the hand is visible from the front, or perhaps rotated to a slightly pinky-finger-down position (showing the back of your hand slightly).
You only slaute officers and specific VIPs. You never salute other enlisted or NCOs (corporals, sargents, Petty Officers) ... only "The Brass." They have you salute NCOs in Boot Camp, just to get you in the practice ... after that, Officers and Warrant Officers only.
Depending on the service, you may or may not have to salute indoors and / or you may or may not have to salute when not covered (wearing a hat), or wearing a duty belt.
FWIW
Scott