Job rule: help (multiple if statements)

With gitlab CI/CD, is there an example anywhere of providing multiple if statement to a rule: that limits when a job will run?

For example, I only want a rule to run if a commit was on either one of two branches, but not any other branch.

this fails (says .yml syntax error)

    - if: '$CI_COMMIT_BRANCH == "main" or $CI_COMMIT_BRANCH == "prod"'
          - requirements.txt