Concept is simple.
I would advise you to refer coremen on it because it has nice theorem based upon how kruskal and prim algorithm select an edge for MST.
Now coming to your question,
Here cut property of MST can be applied which states for any cut of the graph G=(V,E) such that there is an edge e which crosses the cut (S,V-S) (means having one endpoint in S and other in V-S) and for set A of edges that respect the cut(respect the cut means the these are the set of edges which are already included in your MST and now your cut is such that set of edges in A don't cross the cut) and if e is the lightest edge crossing the cut, then e is included in MST of G.
If you make X<4, then the edge AD would be selected in MST.
If you make X=4, there would be choice that you either select AD or CD, in case you can have 2 spanning trees.
If X>4, then edge CD would be selected for MST.
So, maximum values of X so that it can be included in MST shall be 4.