Artificial intelligent assistant

Prove using combinatorics $\sum\limits_{r=0}^n r^2\binom{n}{r}=n(n+1)*2^{n-2}$. Prove using combinatorics $\sum\limits_{r=0}^n r^2\binom{n}{r}=n(n+1)*2^{n-2}$. The left side is choosing $r$ persons from $n$ persons and make one leader and one co-leader such that the leader and the co-leader can be the same.But then the left side should be choose a leader and co-leader and then choose the other which makes the left side $n^2*2^{n-2}$ where did I make a mistake?

It's easier if you rewrite the right side as $n(n-1)2^{n-2} + n2^{n-1}$, then count the two cases separately (leader and co-leader are same, or different.)

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy b2026570bc709cd4bfc574c65cef7580