36 USC 301 – National anthem
(a)
(b)
(1) when the flag is displayed—
(A) individuals in uniform should give the military salute at the first note of the anthem and maintain that position until the last note;
(B) members of the Armed Forces and veterans who are present but not in uniform may render the military salute in the manner provided for individuals in uniform; and
(C) all other persons present should face the flag and stand at attention with their right hand over the heart, and men not in uniform, if applicable, should remove their headdress with their right hand and hold it at the left shoulder, the hand being over the heart; and
(2) when the flag is not displayed, all present should face toward the music and act in the same manner they would if the flag were displayed.