There are two ways of doing moves:
To do castling the king should be moved accordingly and the rook will be moved automatically.
To do taking en-passant just move the pawn as expected.