Ascaris belongs to phylum Nematoda or aschelminthes (Roundworm)
Taenia is a tapeworm or platyhelminthes
Ascaris is also known as small intestinal worms. It is usually found in warm places.
But tapeworm found in damp and moist places
Both are parasite.
But ascaris can cause disease by lack of clean water while taenia divides or lay eggs after successfully attached to the body part of any animal or organism.
Hope this helps !