The following page covers the official standards for rendering courtesy in the Star Army of Yamatai.
Bowing is a part of Yamataian culture and is acceptable for everyone, in and out of uniform.
Any time you want to show respect to a superior of any rank (can be indoors, or to enlisted soldiers)
Certain formal ceremonies (eg weddings)
To non-military persons of prestige (eg royal family members)
To civilian elders
The lower ranked person bows first.
Straight legs with the hands at the sides or folded over the waist.
Deepness varying by the stature of the individual being bowed to and the person bowing.
A nod is an acceptable return gesture to those of lower rank.
Saluting is a military-only gesture of courtesy only rendered to officers in uniform (and to the flag). In most cases bowing is also acceptable.
Salute back when saluted.
When outside* and/or wearing a hat
Reporting (for duty, or as part of a formation)*
Passing a commissioned or warrant officer of higher rank*
For the duration of playing of the national anthem at events
When the flag is raised and lowered
To officers of friendly nations like Nepleslia*
*With these it is fine to substitute a bow