2 valves. One valve plumbed to each of the cylinder end ports. The second valve would be plumbed to the cylinder middle port (you'll only need one side of that valve, so you have to plug the other side).
Best sequence to operate in would be:
-Both pistons (we'll call them main and mid) retracted
-Extend main piston (to get the fully extended position)
-Extend mid-piston, then retract main-piston to get the cylinder to the mid position. May possibly need to regulate the air going into the main-piston-retract side so it doesn't overpower the mid-poistion piston.
-Retract both pistons.
At least that's how I would do it.
Ken