How to choose dimensionality of the Dense layer in LSTM?
This is a very broad and difficult question, because these parameters depend completely on the complexity of your dataset. There is (currently) no "scientific method" to determine these parameters. The best solution is to apply a form of hyperparameter optimization.

See this similar post for more answers.