pandas – Efficient way to filter multiple columns on multiple conditions in Python

I have a dataframe that looks something like this:

pd.DataFrame({'A Code': ('123', '234', '345', '234'),
              'B Code': ('345', '123', '234', '123'),
              'X Code': ('987', '765', '765', '876'),
              'Y Code': ('765', '876', '987', '765'), 
              'H Code': ('AB', 'CD', 'EF', 'AB'})

    A Code  B Code  X Code  Y Code  H Code
0     123     345     987     765     AB
1     234     123     765     876     CD
2     345     234     765     987     EF
3     234     123     876     765     GH

And, I want to find rows where A or B Code is ‘123’ and X or Y Code are ‘765’, or where H Code is ‘EF’ or ‘GH’.

I’ve used

(((df(df('A Code') == '123')) | (df(df('B Code') == '123'))) 
& ((df(df('X Code') == '765')) | (df(df('Y Code') == '765'))))
| (df(df('H Code') == 'EF'))

which works, but gets very long and messy. What’s a more efficient way to do this?