OPINION: With polls showing the major parties running neck and neck, attention has turned to whether this weekend's election will produce a hung Parliament. What would happen then has been the subject of confusion, in part because hung parliaments are rare at the national level. The last occurred in 2010, with the one before that in 1940.

Australia will have a hung Parliament if neither the Coalition nor Labor win 76 seats in the House of Representatives. This is the bare minimum needed for a majority in the 150-member chamber. The Senate outcome is irrelevant, as only the lower house determines who forms government.

If neither side reaches 76 seats, Australia could be faced with weeks of uncertainty. This would be compounded by the fact that the rules governing such a scenario are not well known. They are not set down in the constitution or any other Australian law.

Instead, matters would be resolved by conventions, which are the unwritten rules of our system of government. These are unenforceable, but nonetheless are broadly enough accepted by the political players to dictate their behaviour and that of the Governor-General.

In most respects, the conventions set out a clear course of action. They put the incumbent in the box seat. In the event of a hung Parliament, Malcolm Turnbull, as the last person to enjoy majority support in the House of Representatives, would continue in office.

His grip on power would be assured if he could gain the support of enough independent and minor party members to reach 76 seats. They would need to agree to support the government's budget measures, and to side with him in the event of a no-confidence motion. The crossbenchers could otherwise vote against government proposals.

There may be a complicating factor if this election does produce a hung Parliament. Some of the crossbenchers may have their eligibility to sit in Parliament challenged in the High Court.

If Turnbull is unable to secure crossbencher support, he could still remain as Prime Minister unless either of two things occur. The first would be if the opposition does its own deal with the crossbenchers to gain majority support. Turnbull would then advise the Governor-General to appoint Bill Shorten as prime minister. If, however, Turnbull doubted the sincerity of the crossbench support, he could wait until Parliament sat to test whether Shorten actually had the numbers.

A Turnbull government could also be brought down if the House of Representatives passes a motion of no confidence. Convention directs that a prime minister must resign in the event of such a vote. The Governor-General might then offer the opposition a chance to govern.

Unless it had gained crossbench support, the opposition would be equally vulnerable to being brought down by a no-confidence motion. If this occurred, Turnbull might be given a second chance, if perhaps it was thought that the crossbenchers might support him this time around. Or, it might suggest that Parliament was unworkable, and could precipitate an early election. Such an election would only be for the House of Representatives, there being no basis for cutting short the term of the Senate.

What this scenario shows is that a hung Parliament can produce instability, and the possibility of flipping between governments, unless one side gains majority support by relying upon the crossbenchers. It is very much in the nation's interest that this occur. Without such an agreement, a government can remain in office, but its every move would be scrutinised for whether it might bring about its downfall.

There may be a complicating factor if this election does produce a hung Parliament. Some of the crossbenchers may have their eligibility to sit in Parliament challenged in the High Court.

Section 44 of the constitution sets out a range of grounds on which members are disqualified. They have been removed in the past because they are dual citizens or hold an office of profit under the Crown. The latter ground means that public officers including departmental employees, members of the military and schoolteachers must resign their position before nominating to stand for federal election.

Some candidates in this weekend's poll have nominated without resigning as a local councillor. The list includes Nick Xenophon Team members Karen Hockley and Andrea Broadfoot (contesting the seats of Boothby and Grey respectively in South Australia) and Greens candidate Samantha Ratnam (in the seat of Wills in Victoria). It is arguable, although uncertain, that they are ineligible to sit in the Federal Parliament. The High Court has yet to decide the issue.

If any of these candidates wins, and emerges as a kingmaker in the new Parliament, the result could be protracted uncertainty. A major party unable to gain their support might have their eligibility tested in the High Court. If they are found to be in breach of the constitution, a byelection would need to be held, adding further delay and drama to the selection of Australia's next government.

Professor George Williams is Dean of Law at UNSW Twitter: ProfGWilliams

This article first appeared in The Sydney Morning Herald.