How can I select all those features that has exact same values in their attribute field called "X"? I think that the solution could be something like the Countif function in Excel, but I haven't found such function in QGIS. I know that there is the Group Stats plugin, but I would like to select values and later work with them.
"your_field" = 'value'
Reacting to your detailing comment:
You can chain your expression with logical operators like:
OR ... so in your example it can be:
"your_field" = 'value' OR "your_field" = 'value2'
When you finish writing expression hit Select button.
In this window you can olso browse layer attributes, their values, operators, functions etc.. For more info see Selecting features in an attribute table in QGIS documentation.
On QGIS 2.16 or later just select your layer and then press f3. You'll get an easy dialog for selecting features by attribute.