Generally, you need two pins per motor; one PWM for speed, and one digital for direction. If you have 6 pins total, you can't easily do what you want.
Build an H-bridge with two P-channel and two N-channel power MOSFETs, and two additional signal N-channel low-end drivers for the P-channel gates. This lets you switch direction.
Then, gate the power into that H-bridge with the PWM. This lets you control speed.
If you only have six pins total, and can only use 4 pins for motor control, then I suggest either using an I2C or SPI based motor controller chip, or building something which averages out the PWM to an analog signal, and uses comparators to select forward/backward, and uses the analog signals as a controller for the duty cycle of something that generates a new PWM signal (such as a 555 for each channel.) This allows you to output "0.5" to stand still, "1.0" to go full forward, and "0.0" to go full backward. It is, however, a lot more external electronics.