While watching the Liverpool vs Manchester United Premier League game in January 2020, I got confused on the offside rule when Salah scored a goal.

Salah was well offside when Allison passed the ball to him. I'm confused as to how that is not an offside. I thought it won't be offside when goalkeeper passes the ball only when it's a goal kick, but it wasn't a goal kick, Allison got the ball in open play after deflecting from one of the Manchester players.