I read in Milnor's article "Link groups", where he defines invariants to classify links up to link homotopy, that the linking number is a complete invariant which can tell almost trivial two components links apart up to link homotopy. My question is how do I prove that the linking number is a complete invariant for link homotopy?
The linking number is the same as the homology class that one component represents in the complement of the other. You can reduce any $2$-component link to a normal form by first homotoping one component to be an unknot. Then the complement of this component is homeomorphic to a solid torus, which has $\pi_1\cong\mathbb Z$. So all loops can be homotoped to one representative for each $n\in\mathbb Z$, where $n$ is the linking number.