Current always takes the path of least resistance. In the case of a Tazer, that is down one wire, through a couple of inches of flesh, and up the other wire. Consequently, no current flows through the people on either side.
In the case of an electric fence current flows through the person's hand and arm and then takes the path of least resistance to earth (Usually down their side and through their feet.
hc4361's answer make no sense, because, if there is nowhere for current to flow to, it won't flow, and if it doesn't flow, you can't get a shock.
I suspect that your comment about the last person in line is a misunderstanding of the experiments where a line of people stand on insulators, while the first person in line touches the fence. No current flows, precisely because there is no route to earth. Then, a person stand son the ground (probably without shoes) and touches the last in line. At that point current will flow through the arms and chests of every one in the line, until finally going to ground down the side and through the feet of the last person (the one who is not insulated).