The result of IF looks is this array:
which goes into the TEXTJOIN function as text1.
TEXTJOIN is configured to use a comma as the delimiter, and to ignore empty values.
You will also need toenable text wrapping.
you’re free to use boolean logic like this for AND:
Explained in more detail here.