You are right to use a boolean variable, next is to use if else if, e.g.
boolean result = true;
if (condition 1) {
result = false;
} else if (condition 2) {
result = false;
} else {
}
return result;
You can also combine conditions 1 and 2 with a || operator.