Laying on your stomach, sort of..........
Put your hands on the floor about midway from your shoulders to your hips. Push up until your arms are straight while leaving your hips on the floor this will put your body into a shape that resembles the rocker of a rocking chair. So what's next? Move your body into a rocking motion while maintaining the "rocker" shape. If you practice it enough you'll get to the point where your legs have enough momentum to continue to the upside down postion, and if your arms are strong enough you can push up into a handstand.
This exercise can be modified by laying on a stack of two fold up mats..... one that is the same (or close to) the hieght of a floor bar, and placed up against it, and the second mat laying on top of and extending about 8-12 inches beyond the floor bar. Use the same moton with your hands on the bar and, with your thumbs wrapped around the bar opposite your index finger (my personal preference) use the rocking motion you learned on the floor to rock yourself up to a handstand while being spotted.
This drill shouldn't be used to form a complete working model of a cast handstand. It's just a drill to teach you how to lean forward while your legs elevate behind and above you, and help you build the specific strength that a cast motion requires.
Have fun, but use good leg form!