3 wire solenoid

The common connection (the one you call ground) goes to VCC and the two flying leads go to the collectors of the respective transistors. The snubbing (or flywheel) diodes (2 required) are connected as Anodes to VCC end of solenoids (the common wire) and cathodes to each of the other solenoid connections