Maybe you have a slight misunderstanding of Gauss Law. It states that the integral of the scalar product of the electric field vectors with the normal vectors of the closed surface, integrated all over the surface is equal to the total charge enclosed inside the surface (times some constant). This is true not only for a spherical surface but for any closed surface. In this case a spherical surface is very convenient since because of the symmetry of the electric field, the field vectors will always be parallel to the normal vectors of the surface. Which means that
$$ \oint \vec{E} \cdot d\vec{A}=E*4\pi*r^2 \tag{1}$$
Here, both the left and right side of the equation are a function of the distance from the origin, r and are true for all r. E is the magnitude of the electic field.
Now lets consider the charge enclosed in this surface as a function of r.
Inside the charged ball, this function is
$$ q_{enc}(r)=\frac{4}{3}\pi r^3 \rho \tag{2}$$
where $\rho$ is the charge density per volume. Outside of the ball, no matter at which distance you are, the charge enclosed is always just q(total charge). Combining this with (1) via gaus law as you stated it we get
$$E(r)=\frac{q}{4 \pi \epsilon r^2} \tag{3}$$
outside of the ball, and
$$E(r)=\frac{\rho r}{3 \epsilon }\tag{4}$$
inside it. ($\rho =\frac{q}{(4/3) \pi a^3} $ so your second formula is correct.)
If you use a conducting ball instead, all charges will distribute on the surface of the ball, since they want to be as far apart from each other as they can. Since this means that there is no charge anymore in any closed surface that you imagine inside the ball, this means that the e-field inside is zero everywhere. Outside of the ball, the gauss surface will contain the whole charge again so from outside the formula for the e-field will be (3) again. So you see that from outside, the homogenously charged ball looks exactly like a ball thats only charged on its surface and also exactly like the field of a point charge at the origin with the same total charge.