You would be better off asking your employer than the ask community! One, rely on your training and your companies policy and procedures. No training, no policy and procedures, time to find a different line of work. Call 911, observe what is happening to who, what, where, why, and how! Most important, don't be a hero, or a target!
A security officer should evacuate the building if he hears shots at his post. This is considered as one of the procedures of emergency attacks that may be done by anyone to harm him. When the officer also leaves the building, he can get time to see those who are involved in shooting to help him communicate with the police.