Azure DevOps Pipelines running on incorrect branches
I have solved this issue, it had to do with the path to the pipeline.
I created a directory called pipelines/dev and pipelines/prod in the root of my repo. And I pointed either build pipeline to the respective yaml config file. Now it will only build on the commit of the specific branches.