Necessary and sufficient conditions for average formation tracking of second-order multi-agent systems with multiple leaders