https://www.youtube.com/watch?a=&v=elHqinIm4R

Evan Abrams has a look at how to create lines that will connect dots together in After Effects. We have seen a similar technique before, both in this case use the Ae Beam effect, which will allow you to place each end of the beam in a specific spot. Evan shows how to create the important bits using expressions, so that you can easily duplicate and adjust what is happening in the animation as you go along.

Anyway we’re going to be drawing some lines that automatically connect any two points and can even take being in 3D using that old scale nonsenseEvan Abrams

More resources for Creating Connecting Lines

Micheal Jones has a look at similarly using the beam effect to create connected lines: Using the Beam Effect for Animated Connected Lines in After Effects

There is also a script that you can buy and use to create the connected alines effect easily : Lines Creator for After Effects Creates Connections Between Lines & Object