You will need to provide an infinite loop in your code that only terminates when the user inputs the correct information.
...
boolean invalid = true;
while(invalid){
if(...){
invalid = false;
}
else{
...
invalid;
}
}
...
Also you may try to make use of regex to check your code for conformity to your statuses. Makes your code cleaner and shorter.
As an addition to your code for slight modification, you may choose to read the first two characters and ignore any other characters after the second, that way whatever number of characters the user types, you will only use the first two