We've had a look at intervals ('diads') and now we'll look at triads. The notes at positions 1, 3 and 5 are very important to making chords. OK. Take the root, 3rd and 5th of any scale, and you've got the major chord. So D major would be:
because the scale of D is:
You can take the notes in any order, anywhere on the fretboard and they'll sound a D major of some description.
Some sound better than others. Find the ones you like and / or are easiest to play.
If you want to know the technical difference between them, have a look at inversions