@string(equals(substring(pipeline().globalParameters.ENVIRONMENT_ROOT_FOLDER,0,2)),(substring(pipeline().parameters.TargetPath),1,3)))
this throws error :: function 'equals' does not accept 1 argument(s)
You can use this :
@equals(tolower(pipeline().globalParameters.ENVIRONMENT),'prod')
this resolved the issue