As stated before, the recommended order is release order:
KH1 FM
Re:Chain of Memories
KH2 FM
358/2 Days
Birth by Sleep FM
Re:Coded
Dream Drop Distance
X[chi] series (X / Unchained X (Unchained X is rebranded as Union X) / Back Cover)
0.2 Birth by Sleep
KH3
Important facts.
1. Read the Ansem reports. They are backstory.
2. All the games are important, even though Tetsuya Nomura did say Chain of Memories can be skipped (unlike Coded) back in 2004 in regards to only playing KH2, but still needed to get the full story of the series. The V-Cast game was not made by Tetsuya Nomura and Square Enix. It doesn't exist.
3. Birth by Sleep is a "main and numbered title" game just like KH1 and 2. It was originally going to be a PS2, but things happened, so it moved to PSP in the end. It was referred to as "Episode 0" back during it's original release. It is now called "0.1" due to the director, Tetsuya Nomura, backpedaling after he said he wouldn't go further into the past, which is X[chi]. Also, the recommended play order is Terra, Ven, Aqua, but you can choose what you want.
4. Dream Drop Distance is a main game in terms of story, but overall, it does not move the story enough to be a numbered title game.
5. X[chi] on PC browsers is exclusive to Japan. Unchained X on mobile was made to get the game overseas just like Re:Coded (Coded is a mobile game) on DS. It almost has the same story, but skips and deviates from the story of X on PC browsers. Further explanation in the guide below. X Back Cover is told from a certain groups perspective (X and Unchained are told from the players) during the story of X and Unchained. You can watch it after X on PC browsers (guide below).Union X is the rebranded version and continuation of Unchained.
6. Playing the games are just one part of the story. To get the full lore not explained in the games and fun facts, you need to read Ultimania, Famitsu, Dengeki, etc. interviews. That's exclusive to Japan, obviously. Much like Final Fantasy and any other Japanese series.
7. 0.2 Birth by Sleep is the prologue of KH3. It was taken out of KH3 due to the increase of content in KH3 and Nomura felt he didn't want to ruin the pacing of the story with a long prologue for fans. You'll know what he means when you play a certain KH game.
8. Re:Coded in 2.5 has a new scene that spoils Dream Drop Distance. It is unlocked in theater mode after you watch the whole movie. Of course, since the collections cater to older fans than new, Nomura didn't give a damn. lol
X[chi] guide:
Since many people don't feel like playing a mobile game. Here's the main and side story cutscenes of X on PC browsers and Unchained X. Everything is in order in the link. Close to 2 hours of cutscenes. lol
Main story:
https://www.youtube.com/playlist?list=PLPCJnwphQDQcJOkD9OsmxxMHX7YHE4WP2
Side story (only the 3rd and 4th video are necessary to watch):
https://www.youtube.com/playlist?list=PLPCJnwphQDQcuI95vvxynpL6WRdR9hzB9
Note: The story of X (Now on Union X) hasn't ended yet so the playlist will be update when new story is release. You'll spoil yourself if you look at every video before you watch it. Just start from the first video.
Welcome to a game series that is not for children.