I have pain on my ankle right behind my medial malleolus and my ankle will click when moving my foot what could be the problem?

A few things. Behind th e medial malleolus is the posterior tibial tendon. You may have tendonitis of this tendon, this is more common in someone who's arch lowers or pronated when standing. Ankle clicking can be due to the peroneal tendons snapping out of their groove or retinaculum, (the structures that keep it in place), other times it may just be gas escaping from the capsule.
Tendon rubbing. Could be the tendon rubbing on the bone. Should be checked.