Did anyone watch video to see how that still shot occurred? Just judging from the still, my best guess is: players 1, 2, 3, 4, and 9 were leaving the ice on a full change. Players 5, 6, 7, 8, 10, and 11 jumped on to replace them, with somebody getting confused so they momentarily had 6 guys jump on to replace 5. But just from the still it's possible player 3 or 4 never touched the ice, and was dangling a leg over the boards in preparation for a change that never happened. That would be amusing, because it's possible with a reasonably loose interpretation of the line change rules that there was no penalty on the play. But I doubt it really happened that way.
As an aside, it's kind of fun to have both benches all jump onto the ice to play the last 30 seconds or so of a beer league game 13 vs. 11, and the referees usually laugh it off. But they probably take that more seriously in the NHL.