The math is simple for D.C. United: Win the final two regular season matches and it clinches home-field advantage in the first round of the MLS playoffs.

It’s a landing point that, at the start of a promising season, was expected inside and outside both the locker room and board room. A summer swoon soured the outlook, but with three consecutive shutout victories in response to a three-game losing streak, United now controls its future.

D.C. (13-10-9, 48 points) is fourth in the Eastern Conference heading into Sunday’s showdown with the archrival New York Red Bulls in Harrison, N.J. The Red Bulls (14-13-5, 47 points) and Toronto FC (12-10-10, 46 points) are close behind.

First place comes with a bye, while the next three slots in the seven-team Eastern Conference playoff field will host a single knockout game Oct. 19 or 20.

“The New York game always has a little punch to it, but now it has even a little more zip,” United Coach Ben Olsen said Wednesday. “This would be a big step to getting that game we want here at Audi Field. It doesn’t lock it up, but it would certainly help us keep moving forward.”

United will close Oct. 6 at home against FC Cincinnati, an expansion team with the league’s worst record (6-22-4). The Red Bulls will finish at Montreal (11-17-4), while Toronto will visit Chicago (9-12-11) and host Columbus (9-15-8).

Number of wins is the first tiebreaker, goal differential the second. The Red Bulls are plus-five and United and Toronto plus-four. The next tiebreaker is goals scored, a category in which United is far behind the other two.

“The momentum is with us,” captain Wayne Rooney said, “and we are confident.”

Beyond the recent results, though, United is encouraged about the general uptick.

“The more important thing is finding our form and our identity,” midfielder Paul Arriola said. “Right now, our identity is not quite there yet, but we are pretty dang close, especially three games [ago] when we were questioning what type of team we were.”

United was in terrific form late last year as well, but that was over two-plus months and largely fueled by a flowing attack keyed by Rooney and Luciano Acosta. (D.C. rose from last place to lock up a home playoff game as the No. 4 seed but lost to Columbus in a penalty-kick tiebreaker.)

This year, United’s ascent has been forged through defense. Entering Wednesday’s MLS matches, D.C. was tied for third in fewest goals conceded (38) and second in shutouts (12).

The quartet of Steve Birnbaum, Frédéric Brillant, Joseph Mora and Russell Canouse has allowed a lot of shots but few on target. The defensive midfield of Júnior Moreno and newcomer Felipe Martins has provided a shield, and when called upon, goalkeeper Bill Hamid has made terrific saves.

Olsen cautioned, though, “there are still stretches where we are bending too much. … We still have to find that balance” with the attack.

The attack clicked Sunday during a 2-0 victory over the visiting Seattle Sounders. Limited to one goal since early July, Rooney hit the crossbar twice and set up the second goal with a dangerous free kick.

With Acosta benched, Olsen’s first-choice attacking midfield has blended individual attributes: Arriola’s energy and speed, Lucas Rodríguez’s technical skill and Ulises Segura’s intangibles.

Against Seattle, United seemed as connected and engaged as any time this year.

“I know it’s a little strange solidifying who you are this late in the season, but it’s been that type of season,” Olsen said, citing injuries, tactical adjustments and the arrival of three summer signings.

The first aim, Olsen said, was qualifying for the playoffs, a goal achieved this past weekend before the team even took the field.

“But I think there is more,” he said. “There was an expectation we would be in the postseason, and this team is hopefully ready for more.”

Notes

>> Ola Kamara, who missed the past two matches with a hamstring injury, participated in workouts Wednesday and seems likely to return to active duty this weekend.

Olsen called it a “positive sign. We’ll see how he responds, and if all is good we’ll keep pushing.”

Kamara, acquired before the summer transfer window closed in early August, has scored three goals in four appearances. When he returns, the Norwegian national team striker is expected to back up Rooney. …

>> Reserve defender Jalen Robinson, sidelined four matches with a knee injury, worked out on the side and said he is week-to-week — a positive development after the team’s initial fears of possible ACL damage. …

>> Fox Sports 1 has picked up Sunday’s match; originally the streaming services FloFC and ESPN+ were the only viewing options. The listed starting time is 5 p.m., but because of a national TV pregame show, kickoff will be around 5:25. …

>> Rooney attended his first NFL game Monday, joining about 16 teammates in a FedEx Field suite to see the Washington Redskins play the Chicago Bears. He arranged the outing and paid for a limousine and the seats.

“It wasn’t a good night” for the Redskins, the Englishman said, “but I enjoyed everything else around it — being with the lads probably more than the game. It was good to bond.”

In his 14½ months in Washington, Rooney has attended a Redskins, Capitals, Wizards and Nationals game.

Read more: