basically what is says is :
If the pipeline has been triggered from a merge request -> run the pipeline
If there is a merge request opened for this branch -> do not run
If there is no merge request opened -> run the pipeline
Basically what is says is run either for the main/dev branches, or run only if in a merge request.