Huzur e Aqdas (aba) gives his views on how we can concentrate on our prayers. He mentions:
If you offer namaz for 5 minutes then most probably only 30 seconds of your attention will be on namaz but the other 4minutes and 30 seconds your mind will be wandering.
When for example, you are reciting surah fatiha, concentrate on its meaning. When you are reciting sura fatiha constantly repeat iyyaka na’bodu wa iyyaka nastaeen which means we worship You Allah and ask for your help. If you constantly repeat this then you will achieve concentration to some level. Then until samiallaho you may still have concentration, but likely that after sajda your concentration will stray again.
In our studies for example, we try hard to pass them by learning relevant information; more so on those subjects we are more interested in personally.
In prayer you may say samiallaho and then your attention has wandered that you need to call your friend for example, then when you reach sajda you realise you lost your concentration. Then in sajda you should pray that Allah please give me the ability to concentrate in namaz. Now this will hapen for some time but after a long while you will have concentration.
There is a story of an old man who used to receive Allah’s revelations. He went to a town and in the mosque joined in with the prayer at the back. After a while Allah began showing him a revelation. Now the Imam who was leading the prayer was a businessman and did trading, and during prayer he started thinking that he will collect items from Delhi, sell them in Culcatta, then move on from there to Mumbai etc. All the Imam’s thoughts were being shown by Allah to the old man who then broke his namaz and moved to offer his own prayer. After prayer some people complained to the Imam that this old man stood with us in prayer but broke the namaz and did his own. The Imam told the man off and called him Kafir. The old man responded that Allah had shown him where his thoughts were and said with you I went to Delhi, Culcatta, Mumbai and Jhata. Further on you would have gone to Roos and Bukhara. I’m an old man, I cant do such a long journey!
So concentration in salat is essential. Hadhrat Masih Maud a.s. has said wherever you falter, resume from there and continue repeating those words and then you should be able to keep concentration.