So how many seats are needed to form a government again?
If two coalitions are possible, does the one with the most seats get into power?
Number of seats depends, really. If we assume that every single MP except Sinn Fein would vote in a Confidence Motion on either one side or the other (not necessarily accurate), and that there will be 5 Sinn Fein MPs, then you need 322 people to vote for you to stay in government (because the Speaker always vote with the government in the event of a tie). This doesn't necessarily mean in coalition, it could be in a confidence and supply arrangement where another party won't bring your government down but won't join you officially - Labour and the Liberal Democrats had one of these in the late '70s, and the SNP are offering one to Labour this election.
The Prime Minister gets the first opportunity to form a government. If Cameron thinks he can survive a Confidence Motion, he will submit a government to Her Maj. If he either choses not to submit a government, or loses a Confidence Motion after submitting, then there's no established order but given there is only one other party will be large enough to be Prime Ministerial, it'd be Miliband's turn in reality. If Miliband also choses not to submit a government, or also loses a Confidence Motion after submitting, then there is a second election.
I would expect parties to vote something like this:
Conservatives: For Cameron.
UKIP: For Cameron.
UUP: For Cameron.
Liberal Democrats: Depends. Probably for whoever they think would be most stable in return for getting into government as a coalition.
DUP: Depends. Probably for whoever they think would be most stable in return for policy concessions.
Sinn Fein: Abstain.
SDLP: For Miliband or Abstain.
Alliance: For Miliband or Abstain.
George Galloway: For Miliband or Abstain.
Lady Sylvia Hermon: For Miliband or Abstain.
Labour: For Miliband.
SNP: For Miliband.
Plaid Cymru: For Miliband.
Green: For Miliband.
For the Conservatives to form government, at a minimum, they need UKIP+DUP+UUP+LD+CON to be at least 320, which assumes all the potential abstainers abstain and everyone who could side with them does.