Ax+By=C ------1
Dx+Ey=F -- ---2
Multiply 1 by D
ADx+BDy=CD -----3
Multiply 2 by A
ADx+AEy=AF-----4
Subtracting 3 from 4 gives
0x+AEy-BDy = AF - CD
So (AE-BD)y = AF - CD
y = (AF - CD)/(AE - BD)
To solve for x, substitute this value for y in your fourth equation.
Now to express y in the form you wrote above, divide the top and bottom lines by A
y = {F - C(D/A)}/{E - (D/A)B}
For 3 variables, you do the same but you need more steps.
Firstly, reduce the three 3 variable equations to two 2 variable ones by eliminating one variable. Then do what I did above to solve for the 2 remaining variables.
Then you can substitute these into one of the original equations and solve for the third variable.