I am sorry your having a hard time with your male Yorkie. He is only 5 months old. He might hate his crate, and want out , so he is barking. He might want attention too. i am not a fan of using those shock collars. That is negative training and could injure a small puppy. He learned quickly a way around it too, which means he is a clever little guy.
Use a xpen and potty pads for him, they are more pet friendly. Your little pup is not trying to be bad and annoy you . He is is not .