There are basically 4 different types of corrections done for image stabilization in cameras and lenses.
Number of axis and what type of motion each type compensate for.
2-axis : Yaw + pitch (first generation of sensor stabilization and in most stabilized lenses)
3-axis : Yaw + pitch + roll (second generation of sensor stabilization) In most Pentax DSLRs before K-1.
4-axis : Yaw + pitch + up/down + left/light (used in some macro lenses)
5-axis : Yaw + pitch + roll + up/down + left/right (third generation of sensor stabilization) On Pentax K-1 and later
The sensor itself has 3 motions: Roll + up/down + left/right, but has a motion sensor for each axis of motion it can compensate for.
Angular velocity sensors for yaw, pitch and roll, and accelerometers for up/down and left/right motion.
Yaw and pitch is corrected by up/down and left/right motion of the sensor.