Using row_number() and the modulus to determine column. Then it becomes a small matter for a conditional aggregegation.
Example
Select RulesID
,ObjectID = max( case when Col=1 then ObjectID end)
,TypeID = max( case when Col=1 then TypeID end)
,ObjectID2 = max( case when Col=0 then ObjectID end)
,TypeID2 = max( case when Col=0 then TypeID end)
From (
Select *
,Grp = (1+row_number() over (partition by RulesID order by ID)) / 2
,Col = row_number() over (partition by RulesID order by ID) % 2
From YourTable
) A
Group By RulesID,Grp
Results
