OK, I'm going to assume both amp will run via an 8AWG wire min.
You run the 4AWG (red) into a distriburion block, the back side of the block will have slots for 2-4 (8AWG (red) wires out) you will run one to each amp.
Next ground each amp using a min 8AWG (black), nothing wrong with using 4 though. You can ground each amp seperately.
The only wire that will need split is the power turn on (blue wire) most likely.
If your Sub amp has a pass through you could run that to the other amp for your rear RCA's. BTW RCA's are the only wires the amps should share directly.