filter entity reference by another entity reference field in create content there is two content types "country" and "state".
content type "state" has entity reference field for "country".

there is another content type called "shop" which has two entity reference field for "country" and "state". 

when i creating "shop" it display all the "state" .

but i want something like when user select one country, the corresponding states to the country should display.

how to do that help needed .
It appears like you are looking for Reference field option limit module. Your case is their first example:

Example 1: countries and cities
Suppose you want to label articles (or products, or businesses, etc) by both city and country so both can be used for filtering and searching. You could use a hierarchical taxonomy with city terms as children of country terms, but that doesn't make sense when you come to set up Views filters.
With this module, create two separate taxonomies for country and city (or content types, or whatever entity you want to use). Then add a reference field so that each city points to its country: eg, the term 'Paris' has a reference to 'France'.
Then when editing an article, selecting 'France' in the country field will cause the city field to update to show only cities in France.

And yes, it works with nodes just as well as with taxonomies, as both kinds are entities.