Hello,
lovely buddy !
If I may, here are some little personal tips, while everything Adrienne and JMFS said are all really insightful
To me, it's really looks like reactions issued with crate training, some equivalent of basic crate training may be helpful :
playing IN and OUT game, WAIT IN and close the door, go away few seconds and treat when back, and increasing the time...
But something that worked well with Loki for crate training and pen training was actually things while he was not contained :
You left the contained area open, and you put very high value in there when he does not see you, and let him go in by himself
He will start to think "oh my ! this area is soooo cooool !! It spawns high value treats ! being in there is not that bad after all"
And also doing normal stuff in there, to show it's not just an area of exclusion :
If you want to play some tug, or some chase, just go in with him, close the door behind you both, and play while in there
Same for mental games : Loki looooovveeesss the muffin game. Many times we played it inside his pen. We couldn't obviously make the STAY with distance, but we could train the STAY with time while in the pen
I'm not sure he can put away all the barking and whining, specially if the dog is clingy, and can have FOMO, but it will reduce much
Hope that can help