I am working on the CloudFormation template for creating the IAM role and multiple policies.
In stack1 I'm creating the new IAM role test-role and the policy test-iam-policy.
In stack2 I'm creating the new IAM policy test-iam-policy2 which again depends on the IAM role test-role.
When creating the CloudFormation stack2, the creation fails with an error
"test-role" role already exists in stack arn:aws:cloudformation:* " CREATE_FAILED
In the stack2 creation, how to ignore the creation of IAM role 'test-roleas it is already exists and create only the IAM policytest-iam-policy2`?


The error is pretty clear - you cant create 2 roles with the same name, so thats an expected error when creating those two stacks as described. From your question its unclear your exact intention here, so all i can do is point out some available features that some combination should suit your requirements. I would suggest you research the following topics, and then come back and edit your question with some more context to get more specific answers.
(Also please post text not images of code, theres no way im typing all that :).
[AWS::IAM::ROLE], then remove the Role from stack 2, and replace it with the new parameter.I would encourage you to review the CloudFormation docs on template anatomy, the intrinsic functions and the pseudo variables. The docs really are your best source of info here.
Its worth pointing out you can cause your self difficulties with sub-stacks and references between stacks when making changes down the road - so try and think ahead when you design your template structure. Check out the CloudFront best practice guide in the AWS docs too