Soloing over a rock tune is not that different from playing a blues or funk solo. The most common scales used in these styles are the pentatonic and blues scales. While the blues scale gives you a more bluesy sound as its name says, you can also use the minor pentatonic scale to keep the sound more versatile.
A simple rock solo
In the following two examples, notes from the E minor pentatonic scale are played over a chord simple progression in the same key. Even though the minor pentatonic consists of only five notes, it can be used very creatively on the piano or keyboard. It consists of E, G, A, B, and D.
The E minor pentatonic scale
In the first example, only a few notes are played and breaks separate the short phrases. Still these few notes can create a distinct melody. Note that despite the variation, the melody and rhythm repeat after the second phrase.
The second example mainly features eighth notes, but always comes to rest between the different phrases. Changing between eighth notes and quarter notes can create rhythmic variation. The lines in bar 3 and 5 contain an additional F#, which is part of the underlying D major and B minor chords and can easily be added to the E minor pentatonic.
To get started with your own rock piano solos, use the minor pentatonic scale to create your own phrases over the same chord progression!