I made a cut-away of 3-position cylinder (attached) so you can see the plumbing. This is a bimba 3-position cyl.
If you pressurize the front (left in picture) port, the cylinder retracts all the way. If you pressurize the rear one, it goes to the middle position (because the rear rod has a shorter range of motion). It pushes the forward rod out, but not as far as it could. If you pressurize the middle port, the rod comes out all the way.
If you want to keep track of the position, Bimba sells an option to have a magnetic piston.
http://www.bimba.com/Products-and-Ca...hree-Position/