Your question is very vague, and thus it is difficult to give any precise guidance. Please see Read before posting: How do I get my question answered?
Apart from that, general suggestions would be:
- if you want to write a weak formulation on the entire domain, then those conditions at the interface would come for free, at least if you are using Lagrange finite elements (i.e., continuous). Then the question I guess you are asking is how to define subdomains: see e.g. Defining subdomains for different materials — FEniCSx tutorial
- if instead you want to write a weak formulation on subdomain I and another on subdomain II, then consider reading this
multiphenicsx
tutorial tutorial_lagrange_multipliers_interface