A small sphere of radius $r_1$ and charge $q_1$ is enclosed by a spherical shell of radius $r_2$ and charge $q_2$. If $q_1$ is non-zero and the two spheres are connected by a wire, then, charges will flow from the inner sphere to the outer one; no matter what the charge $q_2$ is. Why???
Let us consider a shell of radius r2. Take another small shell of radius r1
The answer is the difference between the potentials if the two spheres. When the inner sphere is positively charged, no matter if it's bigger or smaller than the charge that resides on the surface of the outer sphere, as long as it's positive, the potential on the inner sphere will be greater than that of the outer sphere. As you know, charges flow from higher potential to lower potential.
So, if the inner sphere was negatively charged, then the charge would flow in the opposite direction.