In this article we discuss confinement of electrons in graphene via smooth magnetic fields which are finite everywhere on the plane. We shall consider two types of magnetic fields leading to systems which are conditionally exactly solvable and quasi exactly solvable. The bound state energies and wave functions in both cases have been found exactly.