As ∮E⋅ds=ε0q,
where q is charge enclosed by the surface,
when ∮E⋅ds=0, q=0
i.e., net charge enclosed by the surface must be zero. Therefore, all other charges must be outside the surface. This is because charges outside the surface do not contribute to the electric flux.