Trading pawns is fine. However, I do not take the pawn, and simply retreat my knight back to e8. This makes it so that if he takes my pawn, I can take back with my c pawn, and he has one less pawn controlling the center, while I still have the same number of pawns controlling the center. One of the main goals of the King's Indian Defense for black is to attack white's kingside, so eventually, in an appropriate time, moving the knight back to e8 might be a solid option to push the f pawn, as long as your king is not in danger.
Help with understanding pawn captures and opening up the center

Okay so then I could have just placed my knight somewhere other than e8 and if he captured my d6 pawn I could have recaptured with my c pawn like you said so I still have 2 center pawns.
But isn’t the point of playing d6 to prevent them from playing e5 so they don’t attack the knight? But this person pushed e5 so isn’t retreating the knight defeating the purpose of playing d6? If that makes sense lol

The other squares for the knight is less beneficial: h5, the knight is sort of useless at the side of the board; d7, it blocks the development of your other knight, as I will explain below.
True, that is one purpose of d6, but it is also for developing your other knight to d7, attacking the opponent's e pawn that he had just pushed, putting more pressure on his pawn and he might feel pressured to take your d6 pawn, resulting in what was said above. You can develop your bishop before moving your knight to d7, or you can just fianchetto your bishop after moving the knight. Notice that if this knight moved to c6 instead, it's still attacking your opponent's pawns, but your opponent can just push his d pawn to kick your knight around

Okay that makes sense with developing my b knight to d7. So then it was correct capturing the e5 push. I just wasn’t sure what to do after he recaptured and was attacking my knight. Thank you for your help
6...dxe5 was good! As a general rule, opening the center is likely to be good for you when you are safely castled and your opponent's king is still in the center, His 6.e5? was premature and left him with serious pawn weaknesses. 6,Nc3 made a lot more sense. Your play was very good and you good a large advantage in the opening. You should have put the game away with 11...Bxb2!. But even with the move you played, you retained a big advantage

Move 12 you play Bg4 where you could just play Rxe2. Picking up a free piece. Even better on move 12 is Bxb2! That wins a pawn and rook. The bishop on e2 remains hanging.

Move 12 you play Bg4 where you could just play Rxe2. Picking up a free piece. Even better on move 12 is Bxb2! That wins a pawn and rook. The bishop on e2 remains hanging.
So true not sure how I didn’t realize that...I feel I was playing too fast when I still had a lot of time

... d7, it blocks the development of your other knight...
Actually, 6. ... dxe5 7. dxe5 Qxd3 8. Bxd3 Nfd7 is exactly the line that I would be inclined to analyze first.

... d7, it blocks the development of your other knight...
Actually, 6. ... dxe5 7. dxe5 Qxd3 8. Bxd3 Nfd7 is exactly the line that I would be inclined to analyze first.
I never considered that. I guess that would work, as white no longer has a d pawn that can attack your knight if Nc6 after your line.
Hello everyone. Can someone help me with the opening to this game? On move 6 should I have captured on e5? Im just confused on when to capture pawns when mine are contested. When should I open up the center? And the pawn on e5 attacked my knight with tempo. Should I have not placed him there? I was trying to learn the Kings Indian Defense. https://www.chess.com/game/live/36541203175