If there is no match, then Match() will return the #N/A error, which will be multiplied with the other Match() result and still return an error. Therefore, this formula will only have a non-error result if BOTH Match formulas return a proper value. That's not what you want, I assume.
You need a formula or function that does not resolve in an error if there is only one match for the two conditions.
One option is to encase each Match into an Iferror. Anonther option is to use Countif, along the lines of this:
=if(countif(G:G,A2)+countif(G:G,B2),"Present","Absent")
Countif returns 0 if nothing is found or a count of the items found. The zero will equal a FALSE in the IF statement, so if neither Countif finds anything, the FALSE argument of the IF function will fire. Bit if any of the two Countif functions find a match, the result will be a number greater than zero, so the TRUE part of the IF function will fire.