If you want him to sleep in his crate at night without barking or whining, you absolutely MUST NOT respond to his barks, and you MUST NOT let him out during the night to sleep in a different bed.
Decide whether you want him sleeping in a bed or in the crate and stick to it. If you respond verbally to his barking, or if you eventually let him out, HE has trained YOU.
The barking will eventually end if you do not respond and if you do not eventually let him out.
The key is consistency. Good luck!