Exp can be gained by:
-Combat against invaders. (Captureing invaders might not give exp)
-Collecting gold generated in the Throne room.
-Working at areas that generate stuff you can collect like gold, medicine, food, and research.
-Finding treasure, gems, prisoners, and technology from sending them to the surface for expedition.
-Expanding your base.
Jails and other rooms that does not generate items will not give exp.