The rules for voting for a new pope after his death are that cardinals over 80 are not allowed to vote.
Only 120 cardinals are allowed to vote at one time; and no cardinal under 80 can be excluded from voting.
As a practical result, a pope is not allowed to appoint more than 120 men under the age of 80 to the cardinalate.
The voting begins with the death of a pope. The death is verified by a special officer, the Cardinal Camerlengo. Traditionally, he does this by standing over the pope’s prone body and calling the pope’s name loudly three times.
If the pope doesn’t respond, the camerlengo starts arranging a funeral, nine days of mourning, and an election.