At no point in the series is Tony actually the boss of the family
In practicality, yeah, he’s essentially the boss the moment Jackie senior dies.
But as far as an officially recognized title? It never happens.
Old man Dimeo is the real boss of the family, but he’s incapable of running it because he’s doing a life sentence. So authority is given to the acting boss, which starts at Jackie then goes to Junior.
Yes, once Junior is under house arrest, he’s essentially an unofficial consigliere to Tony rather than someone with real authority over him. But Tony never officially gets the title, it’s just kind of accepted that he’s the one in charge.
Even after Junior shoots Tony, the series doesn’t indicate he was put on the shelf for it. Which means that, in a literal sense, one can only assume Junior remained the acting boss of the family even as his mind wasted away.