The following are examples of the five pentatonic box shapes. Each scale is both major and minor at the same time, i.e the E major Pentatonic is also the C# minor pentatonic. Refer to ‘An Introduction to Music Theory’, move a major shape up three frets and it becomes the relative minor.
Learn each scale and then it will become obvious to you that when playing in a different key, the shapes are the same just in a different fretboard position. Each time you pick up the guitar use these as a warm up exercise and within a short while they will be imprinted on your brain. Practice them from the nut to the twelfth until you know them, then start in the middle and work both up and down, see how each shape overlaps the next/previous?
Importantly combine the shapes without getting locked in each i.e think ouside the box!
Each example is in E which is my favourite key due to the amount of open strings available (more so for the minor/blues) the root notes E are highlighted by the box around them.
E major pentatonic E F# G# B C# E and C# minor pentatonic C# E F# G# B C#
The E minor pentatonic is also the G Major pentatonic.
E minor pentatonic E G A B D E and G Major pentatonic G A B D E G. All of the open strings fit!
The Blues scale is essentially the minor pentatonic with the added sharp fourth/flat fifth.
E Blues E G A Bb B D E