Necessary and sufficient conditions for causal feature selection in time series with latent common causes