BANGKOK (Reuters) - Two days after an election that was meant to restore democratic rule and stability, Thailand has plunged deeper into uncertainty thanks to a complex parliamentary system that critics say the military junta devised to trip up its rivals.

The Election Commission has been accused of incompetence and even complicity in cheating in Sunday’s poll, and it might take another six weeks to publish official results for the 500-seat lower house.

The commission on Monday announced the winners of 350 seats of the House of Representatives but the remainder will not be announced until May 9.

Until then, it will be unclear whether the next government will be formed by the party that wants junta leader and former military chief Prayuth Chan-ocha to stay on as prime minister or the “democratic front” led by the party ousted in a 2014 coup.

WHY ARE THE FULL RESULTS TAKING SO LONG?

Partly because of complex election rules written by supporters of the junta three years ago, and partly because the Election Commission has yet to finalize a full count.

Most parties in fact estimate their rough share of the seats from partial results and both sides have begun negotiating to put together a coalition on that basis.

Prayuth’s party probably has enough votes to keep him on as prime minister, but it needs coalition partners in the House of Representatives, the lower house of parliament, to form a stable government.

WHAT WILL IT TAKE TO WIN THE ELECTION?

Officially, the magic number for choosing the next prime minister is 376 votes - a majority of a combined vote between the 500-seat House of Representatives and the 250-seat Senate.

But the challenge of getting to 376 votes is different for the two camps.

Because the Senate is appointed entirely by the junta, Prayuth’s party needs only about 126 House seats, either on its own or with coalition partners.

But the “democratic front” of parties led by loyalists of ousted former prime minister Thaksin Shinawatra need to win 376 of the 500 House seats to choose the prime minister because it cannot count on many, or even any, Senate votes.

CONSTITUENCY SEATS VS PARTY SEATS

Only 350 seats in the House of Representatives are directly elected “constituency seats” where the candidate with the most votes wins the district in a first-past-the-post system.

The winners of those seats were announced on Monday.

The pro-Thaksin opposition Pheu Thai party won 137 House seats while the pro-junta Palang Pracharat party, which wants to keep Prayuth in power, won 97 seats.

The non-aligned Bhumjaithai party, which has officially aligned with neither camp, won 39 seats. The Democrat party, which said it won’t side with Pheu Thai, won 33 seats.

A new progressive party, Future Forward, won 30 seats. It would be part of an anti-junta democratic front.

Other parties won 14 seats.

PARTY SEATS

The remaining 150 “party seats” in the lower house are allocated under a complicated formula based on the total number of votes cast and each party’s share of the nationwide vote.

The formula divides the total number of votes cast nationwide by the 500 seats in the House of Representatives. So, if 40 million people were to vote, the “value” of one House seat would be 80,000 votes.

The formula effectively caps the number of seats any one party can gain. If a party has already reached or is close to its limit in constituency seats, it cannot get any more party seats.

The exact allocation of party seats won’t be known until the Election Commission releases unofficial results, which are expected on Friday. That will show total votes cast and the parties’ share of them.

However, the definitive numbers won’t be released until May 9, when the official results are published. That said, partial results up to 94 percent released on Sunday night offer clues.

Because Pheu Thai already has 137 constituency seats, it may well have exceeded its seats “cap” and therefore will be unlikely to get any party seats.

But Palang Pracharat has only 97 constituency seats, and since it was also leading the national popular vote, it is likely to gain 15-25 more party seats.

Adding the seats together would put Palang Pracharat very close to the 126 seats it needs to vote Prayuth in as prime minister, which is why many assume the junta leader will stay on.

SO WHO GETS TO FORM A GOVERNMENT?

Technically either side would need just more than 250 seats, or half of the 500-member lower house, to form the next government.

However, the “democratic front” would need 376 seats in the House to first get one of the prime ministerial candidates from its side approved, since it could not rely on members of the junta-appointed Senate to endorse its candidates.

Palang Pracharat, assuming all Senate members vote in line, will be close to the 126 seats needed to get Prayuth to stay on. However, it will need coalition partners able to rely on more than 250 seats in the House to form a stable coalition government.