tl;dr– This claim appears to be true, noting that the "last two elections" were the 2018 midterms and 2020 primaries, as clarified by a related Twitter message from the original claimant.
In this Twitter message, claimant Sean Eldridge clarifies that they were referring to the 2018 midterm elections and 2020 primary elections.
That same Twitter message cited these articles as support for their claim:
President Trump and first lady Melania Trump have cast their ballots in the 2018 midterm elections.
A White House spokesperson said Friday that both Trumps voted by absentee ballot in New York "a few weeks ago." That means they will not have to travel to the state, where they are registered to vote, to cast a ballot in person.
—"Trump, first lady cast votes by absentee ballot for midterms", The Hill (2018-11-02)
As coronavirus cases started increasing and concern mounted in the days before Florida’s presidential primary, the state’s voters increasingly turned to voting by mail. President Donald Trump did the same thing, taking a moment to vote — undoubtedly for himself.
—"President Donald Trump voted for the first time in Palm Beach County (presumably for himself)", SunSentinel (2020-04-01)
Regarding the meaning of the "last two elections".
As other answers have noted, it's easy to see ambiguity in what the "last two elections" were.
The US holds elections on even-numbered years, e.g. 2016, 2018, and 2020.
Technically, the US holds elections on odd-numbered years (e.g., 2019) too, but these off-year elections are relatively minor events:
Off-year elections during odd-numbered years rarely feature any election to a federal office, few state legislative elections, and very few gubernatorial elections. Instead, the vast majority of these elections are held at the county and municipal level.
Since a US president gets 4 years in-office upon election (often 8 years, if they're re-elected while already in office), US presidential elections happen every other even-numbered year, e.g. on 2016 and 2020, but not 2018. These are presidential election years.
The elections on even-numbered years between presidential-election years, e.g. 2018, are called midterm elections (because they're midway through the current term of the current president).
This claim takes place in 2020. However, since the 2020 presidential election hasn't happened yet, that's obviously not one of the "last two elections".
Before the general elections, major US political parties tend to hold primaries to select their candidates for the general election. Trump is a Republican president, so the 2020 Republican primaries are relevant to him. Apparently this is what the claimant meant by the most recent election.
Then, there were the off-year elections in 2019. However, it appears most folks understood that those probably weren't being referred to.
Then, there were the mid-term elections in 2018, which the claim referred to as the earlier of the two "last two elections".
Then, there were the off-year elections in 2017. Again, it appears that most folks understood that these weren't relevant.
Then, there were the presidential elections of 2016. @Philipp's answer shows that Trump appears to have voted in-person in 2016, which may've led to confusion about the claim as a reasonable person may've interpreted the "last two elections" as the "last two [presidential] elections", excluding both off-year and mid-term elections.
That said, the claimant was pretty clear about exactly which elections they were referring to when making this claim on Twitter, so while a reasonable person may've perceived some ambiguity in the statement as presented in media, the Twitter statement of the claim appears to be pretty clear and unambiguous.