Not offside
The provision as it is printed, and everything on Ruleside that turns on it.
The shot by a team-mate (A) rebounds from the goalkeeper, (B) is in an onside position and plays the ball, (C) in an offside position is not penalised because the player did not gain an advantage from being in that position because the player did not touch the ball.
Worked by IFAB itself 1
One of the positions the Laws answer by name rather than by rule, drawn.
The Laws of the Game are published by The IFAB and quoted here for the purpose of explaining the decisions on this site. Ruleside is not affiliated with The IFAB or FIFA. Every clause of Practical guidelines for match officials that Ruleside cites.