old paint on decking
You definitely need to sand the loose paint off before repainting. Otherwise your new coat will quickly begin peeling as well, since it would be relying on the already peeling paint underneath it for adhesion to the deck.

There are actually disc sanders made specifically for the purpose of removing old flaking paint. Sanding will also help feather the edges of spots where the existing paint has already chipped off. That way you won't get the flaky texture showing through on your new coat.

Prime any areas with bare wood showing, and repaint with an outdoor paint meant for porch/patio/deck floors.