How to make a bone follow another bone using drivers

i tried using constraints but didn’t find a way to make it work with my issue, i tried using drivers and felt that they could work since they allow if statements because what i’m looking to do with these 2 bones has a condition to meet before working.