Homoclinic and heteroclinic chaos in nonlinear systems driven by trichotomous noise