Perhaps this might help as a starting point:
declare @test table
( col1 char(1), col2 char(1), col3 char(1), col4 char(1));
insert into @test
select 'A','B',null,null union all select 'C','D',null,null union all
select null,null,'E','F'
;
with cte1 as
( select
col1, col2,
row_Number() over( order by col1, col2
) as Rn
from @test
where col1 is not null
), cte2 as
( select
col3, col4,
row_Number() over( order by col3, col4
) as Rn
from @test
where col3 is not null
)
select
col1, col2, col3, col4
from cte1 a
left join cte2 b
on b.rn = a.rn;
/* -------- Output: --------
col1 col2 col3 col4
---- ---- ---- ----
A B E F
C D NULL NULL
*/