I know all scales have chords and its notes and every scale contains all notes entire fretbord position not (scale position) and are played on the all of the strings of guitar. But when you write a tab for a song and notes are to be played on the E, B, and G strings, how is it and this is this considered to be a scale position? For every scale and how to find the root note of the scale in any for example fretbord position?
If you create an arrangement for guitar that places all the notes on the three top strings (e, B, and G) it is likely that some of your notes may be part of several different scale positions.
Scales help you find notes that fit into a given key and are useful in improvising or playing by ear or finding the notes you want for a given piece in a given key. Scales are a tool that can help make the process of finding the correct notes easier.
All notes can be found in a scale, but if all the notes in a guitar arrangement of a composition are to be played on the same three strings, some of the notes used might very well overlap several scale positions. You would just ignore the notes in each of these scale positions that land on the strings you don't want to play.
For example you could sketch out all of the notes in each scale position and then simply choose your notes from the ones that land on the 3 strings you want to use - regardless of what that scale position mandates for the other strings.
In the image below (from www.guitarfriendly.net) you can see how all the scale positions overlap (A Major scale depicted). Many notes on the three top strings are common to more than one scale position. But unless your arrangement maintains a very narrow pitch range, it is likely that you will use notes from several different scale positions.
Below the full fretboard showing all 5 scale positions is a picture where I cut the fretboard in half leaving only the 3 strings you want to compose your arrangement with (e - B - G). Simply choose all your notes from the second picture (if you were composing in A major). But you can see that these notes may belong to any of the different parent scale positions. Just ignore the part of each scale that falls on the bass strings.
I think I know what you're trying to say but i would for sure try and move away from tabs and towards using your ears and sheet music / lead sheets.
If you want to figure out scale positions it's as simple as finding the root note, this can be done by going up the string of a guitar and listening to see if the root note matches what you're playing.
once you find the note you're looking for, listen out for major or minor "sounding" keys, playing towards stereotypes can be helpful. depending on what you can hear, start off with a major or minor pentatonic. There's a high chance that one of these will "sound right".
then you need to know how to fill in the "right" gaps of the scale - this depends on modes but can change because music is music and nothing is ever set in stone.
all of this helps towards knowing what scale to play. if you know the arpeggios and scales on each string it can make life easy in being able to play in any position.
it's almost always personal preference over what is right or wrong. if it sounds good then... it sounds good. there is always more than one viable answer