A man who killed six people when he drove into crowds at a Christmas market in Germany has been sentenced to life in prison.