Hello,
Make sure you have the module installed:
Install-Module -Name MicrosoftTeams -RequiredVersion 5.1.0
https://www.powershellgallery.com/packages/MicrosoftTeams/5.1.0
After the module is installed try Connect-MicrosoftTeams.
If this is helpful please accept answer.