Major scales contain 7 notes, and all use the W-W-H-W-W-W-H tone / half-tone pattern to identify the note positions.
The first note in the diagram below (*) is the tonic note, from which the counting pattern begins.
To count up a Whole tone, count up by two physical piano keys, either white or black.
To count up a Half-tone (semitone), count up from the last note up by one physical piano key, either white or black.
So in the example below, we are interested in the major scale in the key of E-flat.
No matter which key name (or color - black / white) a major scale starts on, the same pattern above is used.
The 8th and final note in the diagram is the octave note, named the same as the tonic note, and is the note where the scale and tone / half-tone pattern rule starts repeating all the way up the piano keyboard.
To understand the frequency relationship between a tonic and its octave note, have a look at the Chromatic scale overview.
Below is an example using the Eb major scale.
To learn about major scales, start with the C major scale, which has no sharps or flats, only white / natural notes, just to see how the note positions are identified.
Then maybe have a look at the Eb major scale as shown below, which contains 3 flats.
There might appear to be 4 flats above, but the 4th flat is just the octave of the tonic note, where the pattern starts repeating, so it doesn't count.
The All major scales page contains piano diagrams and key signatures for all major scales.