If you're in the key of Fmaj and your tonal center is G then you are playing G Dorian, which is a minor mode and because it is a minor mode the pentatonic minor works.
Or your tonal center is a minor chord, in this case the 2 chord, Gmin. So G pentatonic minor works.
Probably more ways to look at it, but those are two useful ways.
Shadow