The rules of assigning axes for DH parameters are (as I know them): 1- Z: in the direction of the axis of rotation/translation of revolute/prismatic joints. 2- X: perpendicular to the previous Z axis but not colinear with the current Z-axis. 3- Y: fill the cartesian coordinate.
But my question is: how do you assign the direction of X axis? you can have two directions for X-axis when assigning it. See the picture below