The first "rule" for improvising is to use the notes of the scale so that just the notes that are in the chord to be on the hard beat.
hard beats means if we have a 4/4 bar: 1 and 3
secondary beats are 2 and 4.

The second important "rule" is that the phrase begins and ends on one of the chord note.

I use quotation marks for "rule" because in music there are no rules.