Do is to act as be is to live/work
It seems that you have forgotten to indicate the underlined part of the sentence, but there is only one thing I have noticed in the given sentence above that needs to be revised. It is the part "rise" and "sits at night". This is the revised sentence: We raise the flag in the morning and then take it down before the sun sets. Hope this answer helps.
OK so a compound sentence is basically a sentence that has (for, and, nor, but, or, yet, so) or a semicolon(;) in between it. Example: Jane has four dogs and two cats.