the safest way is to view the lowest note of a chord as the root. In the end that´s how he hear it!
and then there are slash chords like D/G, D major with a G in the bass.
You use those Chords to outline a movment in the bass, e.g.
Am - Am/G# - Am/G - Am/F# - Fmay7 → chromatic bassline, think “Michelle” by the Beatles
The octave, in which a note occors doesn´t play such a big role. the 2nd becomes a 9th and the 6th becomes a 13 because of the nature how chords are built, by stacking thirds on top of each other. So a 9 can appear next to the root, and the 2nd of a sus2 chords can appear in the top voice.
I have to add the there´s no strickt rule how to name chords. I´ve seen so many different chord symbols, many of them appeard wrong to me in theory, but in the end they “did their job” in outlining a harmony.