Use-case of these two statements is quite different, check YANG RFC to clarify which one you really want to use…
when
statement makes existence of node in configuration conditioned -> if when condition is false, the node is not present in config at all (irrelevant if valid or invalid)!
must
statement enforces some condition on the node for it to be valid, so the leaf is configurable, and it may be valid (must cond. == true) or invalid, throwing user a warning, not allowing to make a change to config…
edit: plus, please next time add your yang in text format to allow easy copy for experiments and giving hints, image prevents this and makes users type it manually (if they have time))