I struggled with this for a long time, especially since my DP isn't my ds' bio father and came into the picture when ds was a yr old after he and I were already well bonded (obviously).
Â
Even though dptried hard ds constantly rejected him and would scream if dp tried to play with him, feed him, etc. fwiw ds had never been cared for by his bio father so it wasn't that he missed him or anything.
Â
What finally did it for me was a family counselor who told me, "either you trust this man to be your child's father, or you don't." I had to decide and I decided that I DID. I stopped interfering or engaging the meltdowns.
Â
If ds wanted a sippy cup, whereas before, dp had to pass it to me to hand to ds, I would let dp hand it straight to ds. If he screamed, that was his business. I would empathize "I know you're thirsty, you're sippy cup is right there when you're feeling better" but I didn't give in and do it myself. my actions were undermining dp and even though I paid lip service telling ds that dp could do it by always jumping in I was showing him otherwise. If I disagreed with how dp handled something, unless I felt it was an immediate safety issue I would address it privately.
Â
It was very, very hard at first and I felt awful watching him meltdown. But I'm happy to say that even though they have their clashes from time to time, ds loves his daddy very much and is very well attached to him now. He will ask to go places with him, even without me, and will go jump in his lap, or pull him by the hand to go look at his drawings or toys with hims. Like your ds he was always fine when I would leave them together but put us all in the same room (or house) and it was Mommy Only.
Â
I know it's so hard to not respond to your baby, and I would never suggest you flat out ignore him. But by allowing your dh to respond to your needs even when you are there, and sounding 100% positive and matter of fact about it to your ds, you are showing him that daddy is  a first-rate parent just like you, not a second rate babysitter that he should only settle for if you're not available. I used to talk ds through it without actually intervening. "look, daddy has a snack for you. cheese, yum! That looks great. " But the fact remains that there is no reason that one responsible, attentive parent can't feed a snack, give a bath, or change a diaper any less than the other and at some point we had to stop giving in every time and just muddle through.