Nice sentence! Here is a small fix and a simple explanation.
Corrected sentence: On a summer day, if it rains while the sun is out, a pretty rainbow appears.
Why this is better (easy steps):
- We add the word "it" before "rains" because sentences usually need a subject. We say "it rains."
- "Appears" or "shows up" both work. "Appears" sounds a little nicer in this sentence.
- The comma is fine: the first part tells when, the rest tells what happens.
Other simple ways to say it:
- If it rains and the sun is out, you can see a pretty rainbow.
- When it rains while the sun is shining, a rainbow appears.
Great job — keep practicing!