The correct option is B.
You can test if there are two independent clauses by separating the clauses and seeing if they can stand alone.
They hadn't planned the trip. They returned to the store the next day and bought more peanut brittle.
Since the the two clauses can stand alone, there are two independent clauses.
Two independent clauses constitute a compound sentence.
I would say b. Just like the below comment.
The compound sentence among the provided options is B, which contains two independent clauses connected by the conjunction 'but.' The other options either have one independent clause or are simple sentences. Therefore, B is the correct choice as it meets the criteria for a compound sentence.
;