The building had been owned for 10 years and was being depreciated at 2% per year. So the carrying value / NBV immediately before the revaluation was 800,000 – (10 x 2% x 800,000) = 640,000.
It was revalued to 1,000,000 and therefore the revaluation surplus is 1,000,000 – 640,000 = 360,000.