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. 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.
If you want to clear the map completely:
Defeat all encounters until you have 22,377 Gil.
Defeat Shadow Bahamut, you should have 23,377 Gil before leaving the exploration.
You should conclude the dungeon exploration with a total of 23,637 Gil and 230,347 EXP.