It is quite difficult to understand the correct and exact logic of hexagrams.
Any way, in your case, the second one is right.
The four hexagrams in Korean flag is abbrieviated one; from 8 to 4.
That abbrieviation require some fundamental change in their order and arrangement.
So if you choose the first one, it would be somewhat misunderstandable.