The loop
while (condition)
keeps looping until condition
is false. Your loop is:
while (d1 != 99 && d2 != 29) {
but both halves of the test must be true for the whole condition to be true. Once one of the numbers matches, one half will be false (it will not be not equal).
If you change the condition to OR:
while (d1 != 99 || d2 != 29) {
then only one side needs to be true for the whole condition to be true, or put another way, both sides need to be false for the whole condition to be false. This OR condition can be expressed in English as "while either of the numbers is not the target". Only when both numbers are their target is the entire condition false.