To force object to rotate in one axis only, just leave one axis limited or free, lock the rest.
Let’s say you have a door on a hinge and it should sit at 15 degrees in relation to a wall. To do this, you have to turn constraint itself to face 15 degrees direction.
The other option is to enable drives/motors and set target direction there, but this is a different functionality - motors will actively produce force to keep constrained objects in specific positions.
Twist1, Twist 2 and Swing correspond to Roll, Yaw and Pitch (not specifically in this order). You can see in which axis constrain will work in editor - constraint root will have circles showing the arc of rotation.