Is anyone bullying him? He sounds stressed. Do you have young children or some similar disruptive creature running around the tank
? My suggestion would be to add more cover for him. The safer he feels. the more secure he will feel coming out and the more time he will spend in the open. He won't feel as threatened so he won't go swimming off all the time when anyone approaches. Another thing you can do to help him if your tank is big enough is to add another couple of female dwarfs. He will suddenly be dominant over other fish and that will give him confidence. Small, peaceful, shoaling tetras would also help by acting somewhat like dither fish and making him feel safe. Things like harlequin rasboras, cardinals, rummynoses, black phantoms and neons are useful for this.