You can add formula in IF condition logical_test part like below
if (or(and(1st__formula,2nd__formula),and(1st__formula,2nd__formula)),true,false)
bold one is old rules.
As suggest by @Khalid, you can also remove IF condition as there is no need to apply if.
formula without if...