I do basically like pipeman says.
More times than not, I hookup sewer right away because we shower in our camper and 3 1/2 people showering fills the gray tank pretty quick (like 1 day).
I am about 50/50 on leaving my gray tank handle open to allow my gray water to run down and out. When I know I'm going to be dumping, I close it with enough time to fill the gray tank (couple of showers, or day or so with our galley sink). I have 3 gray tanks and the 3rd one is my outdoor kitchen all by its lonesome-self - that one, I normally have to let the tap run for 10-12 minutes to fill. Waste of water, but what can ya do.
When it's time to dump - I'll pull my black handle and let the "stuff" fly. Once it's empty, I'll turn on the hose to the black tank flush (or for our 1/2 bath, I'll go run the sink/toilet). I let it run with the handle open for a little and then I close the tank again and let the tank fill up with clean water for a bit (3-4 minutes for the tank rinser and 6-7 minutes for the sink/toilet running). I'll pull the handle and dump it again. I usually "flush" the tanks 2 or 3 times. I have clear elbows that let me see how the water is running and my goal is for "pretty clear".
Once I'm happy with the black tanks, I'll then dump the gray tanks. I only ever do one handle at a time and let it completely finish before going to the next.