He stood to attention and gave a military salute to the commanding officer.
Tips
grammar
Formed as verb-object: 行 (perform) + 军礼 (military salute). The same pattern produces 行礼 (perform a courtesy), 行注目礼 (give an eyes-front salute), 行鞠躬礼 (perform a bow).
culture
PLA salute is right hand to the temple, fingers extended, palm angled slightly forward. Required when raising/lowering the flag at 天安门 every dawn and dusk — a daily ritual that draws thousands of tourists.