Population synthesis of accreting white dwarfs: rates and evolutionary pathways of H and He novae