If you see worms in poo after a worming , it is because they had a heavy load and the gut in now not a nice place for them.... so they are leaving.
If you see worms before you worm, they have them and they are going through their natural life cycle, and laying eggs inside the gut then dieing.
Proper worming for what type of worms you have is the key.
Lice/Mites and worms - You would need something like Ivomectrain applied to the skin. ( Do not give to a very weak bird as they can die from the overload of parasite death)
Round worms - Wazine, WAZINE ONLY KILLS ROUND WORMS
Other Types of worms - Safeguard Liquid goat wormer- 1cc per 10lbs of bird, then 3ccs to 1 gallon drinking water for 5 days. repeat in 7-14 days( For very weak birds give 1/2 that amount every 2 days)
Panacure is same as Safeguard
Valbazen - same application as Safeguard, can kill some types of Tape worms
Tape worms - I use horse Zimertrican Gold. It contains prazquantol (sp) About a small pea size dollop in the mouth for 8 lb bird.
It is also a good idea to rotate wormers so worms have a harder time building up resistance to one type.