Employing a compressed air energy storage is a basic strategy to meet the boosted power demand at any hour of the day. During off-peak hours, the air is stored in a storage and it can be used in combustion chamber later. Nowadays, energy efficiency of a system is an important factor and waste heat recovery sub-systems could increase this factor. The following study analyzed a waste heat recovery system of a Brayton cycle from the exergy and exergo-economic perspectives. The system includes three sub-systems. Two ORCs and a PEM electrolyzer are employed to recover the waste heat during charge and discharge phases of the compressed air energy storage (CAES). The system was modeled separately for the charge and the discharge phases of the air storage. Optimal solutions for both phases are investigated by genetic algorithm (GA). The results revealed that within twenty-four hours of system operation, 5.42 kg hydrogen could be produced with the cost rate of 8.37 $/h in charge phase and 6.18 $/h in discharge phase. The highest exergy destruction rate occurred in the combustion chamber with a value of 238.9 kW. The ORC turbines could produce 18.459 kW and 14.993 kW power in charge and discharge phases, respectively. The optimization revealed that optimal ORC turbines power production are 12.743 kW and 11.939 kW in charge and discharge phases.