How do I use command blocks to check the scoreboard for one player remaining?
How to Strictly Detect Number Returned by Target Selector
This would be possible in Java Edition 1.13+, by storing the number in a scoreboard value and testing it for a specific number. But in Bedrock Edition, so far, I only can test for presence or absence, not a specific number.
Commands in Bedrock Edition are quite limited. One way I could think of is using a redstone comparator coming out of the command block, which will light up a redstone signal equal to the number of players detected, but that comes with further side effects, such as only being able to detect up to 15 players.
That said, there may be an obscure way to accomplish your task, but I’m not the best at advanced command use in BE. If you have found a way, please post an answer! Both me and the OP would be delighted to see it.