All right, I will clarify this for you.
Right Pokemon:This Pokemon can hit the Pokemon in front of it, and in the middle.
Middle Pokemon:This is the Pokemon that can attack anyone.
Left Pokemon:This Pokemon can hit the Pokemon in front of it, and in the middle.
Exceptions to this rule are crossing moves. Long- range moves, like Gust or Hurricane, can hit the Pokemon on the other side of the field.
Another thing to remember is that the Pokemon on the side can switch with the middle, in place of a move.
The first Pokemon in your party will be on the left, second, the middle, and the third, the right.