You will need a grand total of seven Pokemon games plus the Isle of Armor, Crown Tundra, Teal Mask, and Indigo Disk to complete your Living Dex, excluding Pokemon Bank and Pokemon HOME. These are:
- Scarlet (+DLC)
- Violet (+DLC)
- Legends: Arceus
- Sword (+DLC)
- Shield (+DLC)
- Sun, Moon, Ultra Sun, Ultra Moon, Brilliant Diamond, or Shining Pearl
- X or Y
Scarlet + Violet are necessary for Gen 9 Pokemon. You need both versions (as well as their respective DLCs) for the version exclusives like Armarouge/Ceruledge and older legendaries.
Legends: Arceus is needed for the Hisuian Pokemon.
Sword + Shield are for Gen 8 Pokemon that aren't in Gen 9, like Obstagoon and Runerigus. Sword is needed for Sirfetch'd, while Shield is the requirement for Cursola. You also need their DLCs to get older Pokemon and legendaries through Dynamax Adventures.
At this point, we're left with just 31 Pokemon. The next games are Pokemon X or Y to pick up Patrat and the Pan monkeys, as none are available later on. This also takes out most of the other lines like Weedle and Pidgey.
Finally, we're down to just 3 Pokemon: Rattata, Raticate, and Castform. These are most easily obtained in Sun, Moon, Ultra Sun, or Ultra Moon. However, if you would rather have the Kantonian form of Rattata, it may be better to use Brilliant Diamond or Shining Pearl, which can obtain the same Pokemon the Gen 7 games can but taking more time to do so.
Regardless of the path you took, your Living Dex should now be complete!
A lot of trade evolutions can be found in the wild in later games, so that shouldn't be too much of an issue. Please note this list isn't necessarily the easiest way to find every Pokemon -- for example, Castform is more convenient to find in ORAS than it is in USUM. This answer might change with the release of Legends ZA, but this is currently the fewest number of games you can use to make a Living Dex.
"...But wait, Amethyst!" I hear you saying. "I want to make my life hell and get Mythical Pokemon for my Living Dex!" And who am I to deny the wishes of the people? Let's go a step further and find out how to deal with as many Mythicals as you can.
Crystal (Virtual Console edition) allows you to capture Celebi. With the closure of the 3DS eShop, you can no longer obtain this game.
Omega Ruby or Alpha Sapphire will let you capture Deoxys for completing the Delta Episode.
The Gen 7 games, once you enter the Hall of Fame, let you scan a QR Code that gives you Magearna. The code will never expire.
Sword or Shield's DLC has a special quest revolving around Keldeo.
Brilliant Diamond or Shining Pearl let you pick up Mew and Jirachi if you have save data from LGPE and SwSh respectively.
Legends: Arceus allows you to obtain Manaphy, Phione, and Arceus through normal gameplay. It also gives you Shaymin if there's save data from SwSh and Darkrai if there's save data from BDSP.
Pokemon GO can yield Meltan through Mystery Boxes, which can be evolved into Melmetal.
Scarlet or Violet: The Indigo Disk has a special quest revolving around Meloetta. Additionally, obtaining the Mythical Pecha Berry through Mystery Gift will allow you to catch Pecharunt; this distribution doesn't currently have an end date.
So, who's left? Victini, Genesect, Diancie, Hoopa, Volcanion, Marshadow, Zeraora, and Zarude are unobtainable through any of these means, so we'll need to dig a little deeper.
You'll need to perform the DNS Exploit on Pokemon Black or White to obtain Victini and Genesect. The sequels won't work because they won't give you the Liberty Pass to find Victini (though Genesect can still be obtained). For a DNS Exploit guide, check this link.
Tragically, Diancie, Hoopa, Volcanion, Marshadow, Zeraora, and Zarude are all currently unobtainable. Keep an eye out for events in the future, though -- you never know how Game Freak might try to promote their next big idea.