When playing a lick that uses four or more strings it will be necessary to change the position of the right hand. There is no rule to when the right hand will change position. Changing the position will depend on which strings and notes are played.
The following lick is played on the first four strings. The right hand first position is used first before changing to the second position midway through the lick. Try using the suggested right hand fingering but feel free to vary the fingering to suit yourself.