Lightning is the same as ordinary electricity. It moves in the same direction as water. Water flows wherever it is low, and electricity flows wherever its resistance is low. And it goes from high voltage to low voltage.
So, lightning mostly travels along the edges of the two clouds that generate the lightning (where the resistance is relatively low). The clouds cannot be square. From a distance, they twist and turn downwards, looking like a jagged shape.