It looks like you want the count of records by dateEsc, but for a specific list of dates.
My first question is: Is there a reason you are using LIKE matching?
The SQL below might give you the expected outcome:
SET NOCOUNT ON;
SELECT COUNT(*) AS groupCount
FROM Log_Esc
WHERE dateEsc LIKE @date0+'%'
OR dateEsc LIKE @date1+'%'
OR dateEsc LIKE @date2+'%'
OR dateEsc LIKE @date3+'%'
OR dateEsc LIKE @date4+'%'
OR dateEsc LIKE @date5+'%'
GROUP BY dateEsc
FOR XML PATH(''), ROOT('ranks')