mathematica rule problem!!

i want to create rule for Polynomial,but it can’t be executed!!
how should i improve it ??

Read about SameQ

and UnSameQ

Did you post an image and not actual cut-and-pastable code?

hi ,can you use some simple words and sentences,beacuse i am not usa ,i am asian,thanks!!
i will continue follow your message^^

Add your code to your question. What you have is not actual code. It is a picture of code. It cannot be run in Mathematica.

Also, my links were intended to point you to some potential errors in your code.
For example

a=1

assigns the value 1 to a, it does not test whether a is equal to 1. For that you need

a===1

You may have other similar issues in you code, but as Daniel recommends, it cannot be examined without the actual code so that we can test it.