Use different post template based on metadata

hello!
I created a CPT “Team User” with 2 taxonomies: “teacher” and “board” via Metabox.

I created 2 page layouts, one for the CPT “Team User” with “teacher” taxonomy and one for the CPT “Team User” with “board” taxonomy

The problem is that some users are present in both taxonomies.

How can I create a dynamic link that contains the taxonomy parameter (in addition to {post_url}) so as to display one or the other page template?