The correct option is
D The sky cleared and we saw a rainbow.
A simple sentence has only one subject and predicate. It has a finite verb with a completed thought. A compound sentence has at least two parts (also referred to as a clause). Each part has its own subject and predicate and makes good sense by itself. Hence each clause is independent of the other and called the main clause or independent clause. The main clauses are connected using a co-ordinating conjunction (for, and, nor, but, or, yet, so).A complex sentence has at least one main clause (which is an independent clause) and one or more dependent clauses, connected using a subordinate conjunction. The dependent clause cannot stand by itself and make good sense. It depends on the main clause.
Option A: The word, "when" is a subordinating conjunction which connects dependent and independent clauses. The clause, "we saw a rainbow" is an independent clause. The clause, "When the sky cleared" cannot stand by itself and make good sense. It is a dependent clause. Hence, this is a complex sentence and this option is incorrect.
Option B: The word, "after" is a subordinating conjunction which connects dependent and independent clauses. The clause, "we saw a rainbow" is an independent clause. The clause, "After the sky cleared" cannot stand by itself and make good sense. It is a dependent clause. Hence, this is a complex sentence and this option is incorrect.
Option C: The two clauses viz (i) "The sky cleared" and (ii) "we saw a rainbow", can stand independently and make good sense. They are independent clausesconnected using the co-ordinating conjunction-"and". Hence, this is a compound sentence and this answer is correct.
Option D: The words, "As soon as " form a subordinating conjunction which connects dependent and independent clauses. The clause, "we saw a rainbow" is an independent clause. The clause, "As soon as the sky cleared" cannot stand by itself and make good sense. It is a dependent clause. Hence, this is a complex sentence and this option is incorrect.