How do a chess game end with Draw and What is stalemate and checkmate

5.2.1
The game is drawn when the player to move has no legal move and his king is not in check. The game is said to end in ‘stalemate’. This immediately ends the game, provided that the move producing the stalemate position was in accordance with Article 3 and Articles 4.2 – 4.7.
5.2.2
The game is drawn when a position has arisen in which neither player can checkmate the opponent’s king with any series of legal moves. The game is said to end in a ‘dead position’. This immediately ends the game, provided that the move producing the position was in accordance with Article 3 and Articles 4.2 – 4.7.
5.2.3
The game is drawn upon agreement between the two players during the game , provided both players have made at least one move. This immediately ends the game.
9.1.1
The regulations of an event may specify that players cannot offer or agree to a draw, whether in less than a specified number of moves or at all, without the consent of the arbiter.
9.1.2
However, if the regulations of an event allow a draw agreement the following shall apply:
9.1.2.1
A player wishing to offer a draw shall do so after having made a move on the chessboard and before pressing his clock. An offer at any other time during play is still valid but Article 11.5 must be considered. No conditions can be attached to the offer. In both cases the offer cannot be withdrawn and remains valid until the opponent accepts it, rejects it orally, rejects it by touching a piece with the intention of moving or capturing it, or the game is concluded in some other way.
9.1.2.2
The offer of a draw shall be noted by each player on his scoresheet with the symbol (=).
9.1.2.3
A claim of a draw under Article 9.2 or 9.3 shall be considered to be an offer of a draw.
9.2.1
The game is drawn, upon a correct claim by a player having the move, when the same position for at least the third time (not necessarily by a repetition of moves):
9.2.1.1
is about to appear, if he first indicate his move by writing on the paper scoresheet or entering move on the electronic scoresheet, which cannot be changed, on his scoresheet and declares to the arbiter his intention to make this move, or
9.2.1.2
has just appeared, and the player claiming the draw has the move.
9.2.2
Positions are considered the same if and only if the same player has the move, pieces of the same kind and colour occupy the same squares and the possible moves of all the pieces of both players are the same. Thus positions are not the same if:
9.2.2.1
at the start of the sequence a pawn could have been captured en passant
9.2.2.2
a king had castling rights with a rook that has not been moved, but forfeited these after moving. The castling rights are lost only after the king or rook is moved.
9.3
The game is drawn, upon a correct claim by a player having the move, if:
9.3.1
he indicates his move, by writing on the paper scoresheet or entering move on the electronic scoresheet cannot be changed, on his scoresheet and declares to the arbiter his intention to make this move which will result in the last 50 moves by each player having been made without the movement of any pawn and without any capture, or
9.3.2
the last 50 moves by each player have been completed without the movement of any pawn and without any capture.
9.4
If the player touches a piece as in Article 4.3, he loses the right to claim a draw under Article 9.2 or 9.3 on that move.
9.5.1
If a player claims a draw under Article 9.2 or 9.3, he or the arbiter shall stop the chessclock (see Article 6.12.1 or 6.12.2). He is not allowed to withdraw his claim.
9.5.2
If the claim is found to be correct, the game is immediately drawn.
9.5.3
If the claim is found to be incorrect, the arbiter shall add two minutes to the opponent’s remaining thinking time. Then the game shall continue. If the claim was based on an intended move, this move must be made in accordance with Articles 3 and 4.
9.6
If one or both of the following occur(s) then the game is drawn:
9.6.1
the same position has appeared, as in 9.2.2 at least five times.
9.6.2
any series of at least 75 moves have been made by each player without the movement of any pawn and without any capture. If the last move resulted in checkmate, that shall take precedence.
https://handbook.fide.com/chapter/E012018