There are many do's and don'ts when it comes to changing on the fly. A player needs to know who they are changing for, and communication is key. Discussing with teammates on different lines in between plays or before a game can mean the difference between a perfectly executed line change or a blown assignment resulting in a goal against.
When players numbers are called to get to the bench for a change, they have to make sure they get off the ice quickly. The game moves fast. When a change is called, and two of your line mates get off and you are still out there for an extended period of time, it can affects strategy and can lead to mismatches.
Since it is not a good idea during live action to have all three of your players change at the exact same time, there will be some overlap. But that overlap should last a few seconds at the most. What is worse, is if the third member of that line comes over the boards and the last line is not completely off, your team may be called for a too-many-men-on-the-ice penalty, giving the opponents two precious minutes of play with your team shorthanded.
There are plenty of situations when it simply is not advantageous to change. Some of these include when your team is on a three-on-one rush, when your team is on a two-on-two move toward the opposing goal, or changing when the other team has control of the puck, especially in your team's defensive zone. There will be times when teams cannot execute a full change, say a player gets trapped on the ice defending against an opponent's extended attack, or your team is looking to take advantage of the other team's fatigued unit. The solution is to substitute one or two players at a time. While appropriate in moderation, it should not become a habit.
At the end of the day, line changes are a chaotic, potentially confusing, sometimes funny and, most importantly, necessary to the game of hockey. Done properly, and your team, and in particular your favorite line or defensive pair (maybe you play on it!), will be on the ice a lot to score goals and win games.