Assuming second range is in Sheet2
try
=IF(B2="TRUE",0,VLOOKUP(A2,Sheet2!A2:C3,3,FALSE)