First, extract text with OCR.
Then Parse; this gives a list of positions. You can then you positions.count to determine the occurrence:

This worked on the screen for this post. Here is the code; you should be able to copy and paste into your flow:
WebAutomation.LaunchChrome.AttachToChromeByUrl TabUrl: $'''https://powerusers.microsoft.com/t5/Power-Automate-Desktop/Count-the-number-of-times-a-window-contains-text/m-p/2095500/thread-id/24911''' AttachTimeout: 5 BrowserInstance=> Browser
OCR.ExtractTextWithOCR.ExtractTextFromScreenWithWindowsOcr WindowsOcrLanguage: OCR.WindowsOcrLanguage.English ImageWidthMultiplier: 1 ImageHeightMultiplier: 1 OcrText=> OcrText
Text.ParseText.Parse Text: OcrText TextToFind: $'''Microsoft''' StartingPosition: 0 IgnoreCase: False OccurrencePositions=> Positions
MouseAndKeyboard.MoveMouseToTextOnScreenWithOCR.WaitForTextToAppearAndMoveMouseToTextOnScreenWithWindowsOcr TextToFind: $'''Microsoft''' IsRegEx: False WindowsOcrLanguage: MouseAndKeyboard.WindowsOcrLanguage.English Occurence: Positions.Count SearchForTextOn: MouseAndKeyboard.SearchTarget.EntireScreen ImageWidthMultiplier: 1 ImageHeightMultiplier: 1 MovementStyle: MouseAndKeyboard.MovementStyle.Instant Timeout: 5 PositionRelativeToText: MouseAndKeyboard.PositionOnImage.MiddleCenter OffsetX: 0 OffsetY: 0 X=> LocationOfTextFoundX Y=> LocationOfTextFoundY Width=> WidthOfTextFound Height=> HeightOfTextFound
Ensure on Parse Text you are using "First occurence only = False".
Good luck!