Obama was a part-time state senator and served as a U.S. Senator for less than two years before he ran for president. He has the weakest resume of any POTUS in history IMO. Before he announced he even admitted he wasn't qualified to be POTUS.
Obama was a part-time Senator because like Oregon, Illinois has a hybrid part-time legislature. 26 states have hybrid part-time legislatures. He was a U.S. Senator from January 2005 until November 2008, when he was elected President. He was a U.S. Senator for 3 years and 10 months. If you are saying running for President consumed much of his time after announcing his bid for President in February 2007 campaigning, this is very likely true.
Regardless how little political experience Obama had when he was elected President, he had more experience than Trump, since Trump had 0 experience.
The 2020 Donald Trump presidential campaign is an ongoing re-election campaign by Donald Trump, who took office on January 20, 2017. Trump began his reelection campaign unusually early for an incumbent president. In other words he is using his time in office to run his campaign. This mean he has only been working part-time in his current position.
Legislatures in the Gray category are hybrids. Legislatures in these states typically say that they spend more than two-thirds of a full time job being legislators. Although their income from legislative work is greater than that in the Gold states, it's usually not enough to allow them to make a living without having other sources of income. Legislatures in the Gray category have intermediate sized staff. States in the middle of the population range tend to have Gray legislatures.