There are 7 different positions that a player can play in. Each player will have a natural position that he can play in, and the effectiveness of a player in that position is determined by his attributes. The player's rating is also calculated from the main attributes he needs to perform well in his natural position. The positions and the attributes required are detailed in the basic tutorial.
However, players can be played out of position if he has the attributes required for that new position. But there will be a penalty applied to his attributes depending on how far away he is from his natural position. This penalty also depends on the Flexibility hidden attribute, meaning the penalty will be lower for players with high Flexibility.
Playing a goalkeeper in outfield will incur a heavy penalty no matter how high his non-goalkeeping attributes are. So deploy a goalkeeper in outfield only if you do not have any other choice. The penalty for playing an outfield player as a goalkeeper is also similarly high, but slightly lower than the other way around.
Players having CB and WB positions are best suited to play in the defensive line, however DMs can also play relatively well in your defense. WBs are best when deployed wide whereas CBs perform at their best when in the centre of defense. If you are playing a WB in the centre of defense, make sure he has a good Heading attribute to deal with aerial balls. A WB can also be used in wide defensive midfield positions (DML/DMR) if he has good Passing skills and Flexibility.
DMs, AMs and WMs are the players who occupy the midfield of a lineup, with WMs playing wide and DMs/AMs cherishing more central roles. Both DMs and AMs can be equally deployed in central midfield, the difference being that AMs will be attack minded and DMs will be more defensive minded. However, playing a DM as an attacking midfielder or an AM as a defensive midfielder will invite performance penalties, so does using a WM in central roles.
WF and CF are your attacking players, CF prefers a more central role and WF better when played wide. But WFs can also be deployed in the centre of your attack if he has good scoring skills. And a flexible WF can also alternatively play as a wide attacking midfielder (AML/AMR) provided his attributes are suited to play in that position.