Rubbing is a sign of irritation for one reason or another. Before doing anything, especially medicating, please post your water params for ammonia, nitrite, nitrate, and pH. What size tank is it in? What other fish are in the tank? How many? How long has the tank been set up? What is your maintenance schedule?
The more info you post here the faster we can help you.
VERY IMPORTANT: do not medicate until you know what your water params are. If there is ANY ammonia or nitrite, or high nitrate (above 60), the meds can be toxic. Also, depending on what other fish are in the tank, not all meds are safe for all fish. If you post the info asked for then we can help you to sort it out.