Camera follows character only on X-axis and not on Y-axis

Is there a way to make the camera follow the character only on one axis (X-axis) and be locked on another axis (Y-axis) just like in the old school beat 'em up games? And how to go about following 2 players and bounding them in the frame?