I believe it is custom to salute the most senior officer on the parade square upon appearing on parade. But here’s a problem - junior officers tend to arrive first, and senior ones later. So say that I have just saluted an Lt and a Capt appears. Do I salute him too as he is now the most senior? And if the Maj appears after him do I salute him too?
Short answer: yes.
Technically the Lt and Capt should also salute the Major when they arrive
There are many versions of “appearing on parade” depending on how/why you are parading, but if the first officer is taking over from you in charge of the formation then it is no longer your problem
You should salute all officers no matter of their seniority
If you’re talking about being on parade and officers are arriving separately and not together walking towards you, then yes you would salute each one as they arrive.
I have precisely one officer who remembers that - and he was a regular Army officer before becoming a teacher. It shows.