Its not a rule at Juve, its circunstancial.
Dybala also wore the armband ahead of Bonucci when he came back, and now Bonucci ahead of Dybala. Ronaldo was also offered the armband at times when he isn't the most senior player.
Its flexible.
There is no fixed rule because that's stupid, but there is respect through seniority.
Has Ronaldo ever worn the armband? I think he got thrown it once after two captains got subbed in a game (Bonucci then Higuain), and he gave the armband to Matuidi, who I believe was the outfield player left on the field who had most appearances (Buffon was in goal). In fact that Udinese game is the kind that backs up my point.
When Marchisio was here he was 3rd based on this. When Mandzukic got it once he had the most with the exception of Bonucci, who had just returned from his traitor stunt at Milan. Same for Dybala in his odd game with the armband.
If Buffon and Bonucci hadn't left and returned you'd still see the appearance seniority of Buffon, Chiellini, Bonucci, Dybala, Alex Sandro, Cuadrado etc. It's right that Chiellini has it, so I'd then be surprised if it isn't Bonucci captain and Dybala vc next season, presuming Chiellini retires.