Well your sample space is Now you need to find the event space. If we have positions, red can only be in one of the following ways:

_ R _ R _ R _ R _ R _R

R _ R _ R _ R _ R _R_

So we only have choices for red. Now no matter where we place white and blue they are not next to each other, so we have ways of placing the remaining beads.

That is