It is important to understand how a major scale is made up. Remember a tone is a two fret move and a semitone is a one fret move. A major scale is made up of 8 notes, the 8th note being the octave. Usually books will write the 8 steps of the scale in roman numerals like this ( I - I - III - IV - V - VI - VII - VIII ). To modernise this we will just use the numbers 1 to 8 ( 1st - 2nd - 3rd - 4th - 5th - 6th - 7th - 8th notes of the Major Scale) or just ( 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 ). Then we place the correct spacing between each of those eight notes.
Remember: t = Tone (2 fret move), and s = Semitone (1 fret move).
(1) -t- (2) -t- (3) -s- (4) -t- (5) -t- (6) -t- (7) -s- (8)
We can also call a tone a whole step and a semitone a half step.
The above diagram shows that the 1st to 2nd note is a tone apart. The 2nd to 3rd note however is on two different strings but they are still a tone apart.
As you can see below all three scales would be A major scales if they were played from the 5th fret. The root note which is marked by the darker circle is placed on the "A" note, it's that simple. So when you learn the shape of a major scale on the guitar, you have learnt every major scale e.g. ( A, A#, B, C, C#, D, D#, E, F, F#, G, G#, A ). It all depends on where you start the scale from.