A former University of Virginia student has been sentenced to life in prison for fatally shooting three football players and wounding two other students on the campus in 2022.