If you say that someone is counting their chickens, you mean that they are assuming that they will be successful or get something, when this is not certain.
If someone is running round like a headless chicken or rushing around like a headless chicken, they are panicking when they should be thinking carefully about what needs to be done.