In order to gain the maximum amount of experience points possible, you must win all monster encounters available until obtaining a certain amount of gil from each of the two zones. You can open the menu to keep track of the amount of gil you obtained from the dungeon. Because the amount of gil you can collect is predetermined, it will indicate your progress in defeating all available monster encounters.
Stay within Zone 1 until you've collected 2,926 gil, then move on to Zone 2 until you've collected a total of 4,408 gil and then proceed to fight boss after that. You should conclude the dungeon exploration with a total of 7,489 gil and 60,064 EXP. [1]