I want to add a condition if the first time the file is not present on SFTP then it should check again
In order to check if the file is present or not, you can use List files in folder
action.

Then you can check for file's existance by looping through files inside that folder using DisplayName
Variable.

I want to add a condition if the first time the file is not present on SFTP then it should check again after 5 min for 3 retry attempts.
Whereas For the above requirement, when you want to retry you can use until Action of Control
Connector.

Then set its count to 3 from Change Limits. Below is the flow in my Logic app

In the next step you can use Delay action and set its limits to 5 minutes.
So that for every 5 minutes the flow is going to check whether the file is present or not in sftp for 3 times.

Below is the whole flow that satisfies your requirement.
