Additional features, settings, or issues not covered by specific Microsoft Teams categories
It's the box that comes up when you click on "system preferences" then "security & privacy"
If you unlock that the bottom left corner, then make sure all the teams permissions where required are ticked and then leave that box open and doing the screen sharing in teams when not in full screen mode, it should hopefully work like it did for me.