As I teach in Fretboard Theory Chapter 7 (Roots, Keys and Applying Scales), you must identify the one major scale that the whole progression stems from in order to know what major scale to use for melody, riffs, and solos. But the pentatonic needs only to correspond to the root chord in a progression.
Major Scale Patterns
For example, the guitar solo in the acoustic version of “Layla” by Eric Clapton uses the chords Dm, Bb and C with Dm functioning as the root (where everything leads to and resolves). These three chords together can only fit into the F major scale. So you can play F major scale patterns over the whole progression.
Pentatonic Scale Patterns
Since Dm is the root chord, you can play Dm pentatonic over the whole progression as well. In fact, the pentatonic notes are all in the major scale. So the pentatonic is really just the major scale minus two intervals (in this case the 2nd and minor 6th). But guitar players visualize and play in pentatonic and major scale patterns differently. This is why we have names for the two and they’re taught differently.
Clapton’s approach to this solo section is a combination of both. Some of his phrases are based on full major scale patterns while others are in typical pentatonic boxes.
Music Theory For Guitar
Of course, there are more options to choosing scales for solos but what I’ve outlined above is what is generally done most of the time. Be sure that you completely understand this guitar theory and have mastered applying these concepts before you explore more complicated ideas.