The wikipedia page is very general and is more about when than how:
Around 1200, the rules of shatranj started to be modified in southern Europe, and around 1475, several major changes made the game essentially as it is known today. Pawns gained the option of advancing two squares on their first move, while bishops and queens acquired their modern abilities.
What I'm confused about is how people came up with new ideas for chess, and why they were added to the game. So maybe you guys can help?
Castling: Originally the king could leap much like a knight does or move twice on his first move. What version of the leap was used really depended on region. At the time of the leap the queen and the bishop were weak pieces and the king was relatively safe on his home square. Then in the 16th century the bishop and the queen got stronger so catling was invented to both protect the king and get the rooks involved. The first mention of it was in a book written by Roy lopez where it took two moves, first moving the rook and then the king. Now as with most things in chess different regions had different variations of this and it changed as time went on. Some regions had the rook being placed anywhere while others had the king being placed on a1 g1 g8 a8. The current version of castling originated in france and england in the mid 1600s. Johann Allgaier came up with the notation 0-0 and Aaron Alexandre came up with 0-0-0.
En passant:was invented sometime before the 17th century in response to the ever growing popularity of the change to pawns movement allowing them to move twice on their first move. The rule was not universally accepted until the late 1800s when the italians rules were modified. Its purpose was to prevent a pawn from evading being captured by another pawn by moving two squares.
I can scrounge up sources for these if its needed most of that is just what i remember though im pretty sure its accurate.