Easy. You either split the out puts into 2 sets (2nd set off to the sub amp), or you use an amp with single input and 4 out puts (send your headunit outputs into the amp input then 1 set of amp out puts to speakers, and other set to sub.
Or you can run the amps in series - headunit outputs to amp 1, amp 1 out puts to speakers, then amp line outs to amp 2 input, amp 2 outputs to sub