Overhead pressing is an effective way of strengthening your shoulders. With that said, it is important to respect the complexity of your shoulder joint to avoid provoking pain down the line. As your arm (humerus) elevates, the shoulder blade (scapula) must follow with an upward rotation and shrug at the top. This creates a stable base for your shoulder to withstand resistance overhead. If your shoulder blade does not move through a full range of motion, the deep structures in your shoulder may impinge (⬆️migration of the humeral head, ➡️⬅️subacromial space). The ideal range for your arm to get above your head is ~180 degrees, from your hip, without compromising your spine or rib cage. However, this alone does not prevent shoulder pain from occuring. Instead, this should be viewed as a prerequisite before adding progressive resistance overhead. If you participate in a sport that requires a lot of throwing or you are currently dealing with shoulder pain (other possible pathologies), you will need further evaluation.
In horizontal push and pull exercises, the top of the arm (head of the humerus) should stay secured in the shoulder (glenoid fossa) throughout the entire range of motion. The top of the arm may translate forward (relative to the acromion) as the elbows pass behind the hip, which can be a contributing factor in future shoulder pain. This may be brought upon by an excessively rounded (kyphotic) spine and/or forward tipping of the shoulder blade (scapular dyskinesis). However, if the back and shoulder blade are not compromised, you can self-correct by simply monitoring and avoiding this glide. You will often see this at the bottom of a bench press or top of a bent over row.
The resting position of the shoulder blade (scapula) is generally ~2 inches away from the spine, between 2nd and 7th rib. Protraction and retraction of the shoulder blade can be described simply as moving away and toward from the center of the body, however, ligaments and muscles surrounding the collar bone (clavicle) and rib cage (thorax) cause moderate tilts and rotations. As the shoulder blade glides along the rib cage, the joint where the sternum and collar bone meet (SC) protracts/retracts and the joint where the shoulder blade and collar bone meet (AC) rotates. Proper interaction of these joints decreases the chance of impingement and/or rotator cuff compression from shoulder blade alteration (scapular dyskinesis).