When Prime Minister Benjamin Netanyahu called for early elections in December, amid opposition within his coalition government, he was poised to comfortably win a new mandate. The three-term premier rode a wave of home support during Israel’s 50-day summer war in Gaza, and though his approval ratings had since dipped, his job appeared safe.

A lot can change in three months, let alone weeks. In early March, Bibi, as he is popularly known, addressed a joint meeting of Congress and blasted an emerging nuclear deal between Iran and the six world powers, saying it “paves Iran’s path to the bomb.” The speech left Israel divided two weeks before the vote.

Get The Brief. Sign up to receive the top stories you need to know right now. Please enter a valid email address. Sign Up Now Check the box if you do not wish to receive promotional offers via email from TIME. You can unsubscribe at any time. By signing up you are agreeing to our Terms of Use and Privacy Policy . This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply. Thank you! For your security, we've sent a confirmation email to the address you entered. Click the link to confirm your subscription and begin receiving our newsletters. If you don't get the confirmation within 10 minutes, please check your spam folder.

When Israelis go to the polls Tuesday, Netanyahu will face an empowered opposition that threatens to displace him. Recent polling shows his conservative Likud Party trailing the Zionist Union, a hybrid of the center-left Labor and the small centrist Hatnua. Still, Netanyahu has a good shot at staying in power if he can cobble together at least 61 of the Knesset’s 120 seats and form a coalition government, but there’s no guarantee.

Here’s what you have to know about the elections.

Who’s running?

Netanyahu, 65, would become Israel’s longest-serving Prime Minister if he wins a fourth term and serves until July 2019. His campaign has largely focused on national security issues, playing into the concerns of the country’s right-wing majority. On Monday, on the eve of the vote, he withdrew his support for a two-state solution, saying a Palestinian state would provide “attack grounds to the radical Islam against the state of Israel.”

His strongest challenger is Isaac Herzog, the son of a former President, a longtime politician who leads the Labor Party. Days after Netanyahu called for the early elections, Herzog, 54, announced an alliance with Hatnua’s Tzipi Livni, formerly of Netanyahu’s cabinet, giving the combined Zionist Union a lead over Likud. The alliance’s campaign has largely skirted security issues and instead focused on domestic worries like housing shortages and the high cost of living, which surveys show high on Israelis’ list of concerns. Herzog and Livni had agreed to rotate the premiership if their Zionist Union comes out ahead but, in a sign of Herzog’s rising popularity, the leadership agreed to drop that plan and back the soft-spoken Labor leader for premier.

In a surprise move, Israel’s four Arab parties joined forces for the first time (despite a host of internal divisions). Led by Ayman Odeh, a 40-year-old lawyer from Haifa, the Joint List is poised to become the third-largest faction in the Knesset on the vote of Israel’s 1.7 million Arab citizens. Odeh has said his alliance won’t join any government, but he could tip the balance if he recommends that the President nominate Herzog to form a government.

Neither of the leading parties is polling more than 25 seats out of the 120, so the next government will largely hinge on smaller parties that might link up for a broader coalition. Look for both Netanyahu and Herzog to court Moshe Kahlon, whose centrist Kulanu party has seen a surge in support over the last month and is now polling around 10 seats. Though he was a former Netanyahu ally in Likud, Kahlon hasn’t ruled out backing the Zionist alliance.

What do the opinion polls say?

The Zionist alliance holds a slight lead over Likud, with 25 seats to Likud’s 21 (the exact numbers vary, depending on which poll you look at).

Netanyahu is losing in the opinion polls. Does that mean he’s out?

Far from it. For one, polling has been notoriously unreliable in Israel, where up to 20% of voters may still be undecided.

But the elections are also only the first step in forming the next government. Since no party will win a majority of seats (nor has one since 1949), the leading parties will likely have to compose a coalition government—that’s where the smaller parties come in. Going by the Israeli system, current President Reuven Rivlin will consult with all parties to nominate a member of the Knesset with the best chance of forming a coalition as Prime Minister.

Netanyahu appears to have a better chance at forming a government, if the current polling holds, thanks to the presumed support of the substantial bloc of right-wing and religious parties. But a Herzog government, with help from Kulanu, could also theoretically align itself with others from across the spectrum to come out ahead.

The leading parties could also conceivably come together to assemble what’s known as a National Unity government. Herzog and Netanyahu might decide to shelve their differences and participate in a shared government, rotating the premiership, as Shimon Peres and Yitzhak Shamir did from 1984 to 1988.

What if Netanyahu loses?

A Herzog-led government would likely focus on the Zionist Union’s campaign pledge to tackle the rising cost of living. While the alliance has pledged to resume talks with the Palestinians after the last round of negotiations on statehood collapsed in April, the economy would remain its priority.

What if he wins?

If Netanyahu aligns with the right-wing and religious parties to forge a fourth term, his government is expected to continue its focus on national security issues, emphasizing the rise and threat of Islamist militants along Israel’s borders, just as he did when declaring that he no longer supported a Palestinian state. Netanyahu will also face an uphill battle repairing ties with President Barack Obama after his controversial address to Congress, during which he criticized the emerging “bad deal” with Iran over its nuclear program.

So when will we know?

Israeli television will begin to broadcast exit polls after 10 p.m. local time (4 p.m. ET).

Once Rivlin nominates someone to form a government, they will have 42 days to do so before the President selects someone else to try. If he or she fails, anyone in the parliament can propose a majority coalition. In the unlikely (and unprecedented) scenario both attempts come up short, it’s back to the polls.

Read next: Netanyahu Vows No Palestinian State While He’s Prime Minister

Listen to the most important stories of the day.

Write to Noah Rayman at noah.rayman@time.com.