Actually there is no such law Toni.
Military personnel must salute or remove headgear (if in mufti) when the National Anthem (or "To the Colors") is played but only if it is in conjunction with raising, lowering, or positioning the flag. At other times such as Olympic events or car races or whatever military personnel are supposed to stand at attention and face the flag if visible or the music if the flag is not visible with headgear removed. Civilians are expected to do the same simply as a matter of etiquette but not of law.
This does not apply when you hear the National Anthem on the radio or television.
The same standards apply for other nation's flags and anthems too.
Until I heard the statement on the NBC news a few minutes ago I never knew.....
In Greece, the medal winners have been given a wreath to wear. Some USA people have taken it off and put it over their hearts during the playing of our National Anthem. Others kept the wreath on.
Evidently it is an actual law in the USA that you remove all headgear during the playing of the Anthem...but the winners in Greece are getting a 'free skate' to use their own discretion.