Moon and stars r always present in the sky,, but the daylight blurrs it ..as the light of sun is more brighter than the light of moon and star we cannot see them always.
we know tat moon is the most brightest object after sun.but the sun is many times more brighter than the moon .
another situation wen we r unable to see the moon is during lunar cycle-new moon.
in the case of star ,,the same thing is applied.due to the scattered sunlight in day, the star light is not distinctly visible.
rainbow appears only after rain.bcause the white light need a prism medium to be scattered into its constituent colours.
hope tis helps u...