The line of players closest to the goalie is the defenders (Left back, 2 center backs, and a right back) depending on what formation you use you could have more or less defenders
The line of players on the the midline is the midfielders(There are attacking and defending midfielders depending on formation)
The front line of players are the attackers (Right wing, striker, left wing) There can be more or less attacker based on the formation
3-5-2 is an example of a soccer formation with 3 defenders, 5 midfielders, and 2 attackers