The root note of a B major chord is the B, the F# is the fifth of the chord, if the F# is the lowest in tone in the voicing of the chord then that is still the fifth of the B chord and not the root, it is only a B major chord in what is called the second inversion;
root position B major chord is B D# F#
first inversion B major chord is D# F# B
and second inversion is F# B D#
These are all B major chords and B will always be the root.
Hope you understand it better now?