Massimiliano Allegri has been relieved of his duties as Juventus head coach after three years at the helm.