Initially Nodes are inserted in an AVL tree in the same manner as an ordinary binary search tree.
Though, the insertion algorithm for any AVL tree travels back along with the path it took to determine the point of insertion & verify the balance at each of node on the path.
If a node is found which is unbalanced (if it contain a balance factor of either -2 or +2) then rotation is performed, depend on the inserted nodes position relative to the node being examined (the unbalanced node).