A compound sentence is composed of at least two independent clauses. It does not require a dependent clause. The clauses are joined by a coordinating conjunction (with or without a comma), a correlative conjunction (with or without a comma), a semicolon that functions as a conjunction, or a conjunctive adverb preceded by a semicolon. A conjunction can be used to make a compound sentence. The use of a comma to separate two independent clauses is called a comma splice and is generally considered an error (when used in the English language).
My friend invited me to a tea party, but my parents didn't let me
Do you want to stay here, or would you like to go shopping with me?
I have a lot of work to finish, so I will be up all night.