En passant
En passant lets a pawn capture an adjacent enemy pawn that has just advanced two squares as though it had moved only one.
The capture is legal only on the move immediately following the two-square advance. If the opportunity is declined, it disappears.
En passant exists for one move only
En passant becomes available when an opposing pawn advances two squares from its starting rank and lands beside your pawn after passing through a square your pawn attacks. You must capture on the immediately following move or lose the right.
Move the white pawn from e5 to d6.
Move the white pawn from e5 to d6.
The capturing pawn lands on the passed square
The capturing pawn moves diagonally to the square the opposing pawn passed over. The opposing pawn is removed from the adjacent square where its two-square move ended.
exd6- A white pawn on e5 captures a black pawn that just moved from d7 to d5.
King safety still applies
Removing two pawns from different squares can open a rook or bishop line. An en passant capture is illegal if that newly opened line would leave the capturing side's king in check.