a) I am taking the bus tomorrow.
b) I am going to take the bus tomorrow.
If I was back teaching ESL, I would tell my students that both of these sentences, while grammatical, are not fluent English. Native speakers don't say sentences like that. We can deal with the semantic difference later.
- First, nobody ever says "I am" in two words, unless they're reading aloud. Just as I will is usually pronounced I'll /a:l/, I am is almost always contracted to I'm /a:m/, unless the am is stressed, as it is when it appears isolated at the end of the sentence, like:
He's not enjoying this as much as I am.
- Second, nobody ever says going to; it's always pronounced gonna /'gənə/. It's a fused idiom, like have to /'hæftə/, with its own grammar and pronunciation.
As for the meaning difference, there is little, but what there is focusses on the immediacy of the imagined future event. For instance,
- Look out! That rock is gonna fall!
- ??Look out! That rock will fall!
The progressive for the future is usually a matter of personal plan, whereas gonna signals imminence, if anything. It's not surprising there isn't much difference in most contexts.
a) I lived in Kerala for 2 years.
b) *I used to live in Kerala for 2 years
(a) is a normal grammatical sentence, but (b) is ungrammatical, because of the grammar of the idiom used to. That idiom asserts a proposition in the past tense and also presupposes its negation in the present tense. That sounds complicated, and it is.
- I used to live in Michigan.
(I lived in Michigan is the past proposition, which can be denied;
I don't live in Michigan is the present proposition, which can't be denied.)
If I say I used to live in Michigan and I never lived there, I'm lying. That's the assertion in the past. But if I have lived in Michigan all my life and I say that, am I lying? Certainly misleading, but by presupposition.
As for for 2 years, that won't go with used to here because the proposition being asserted is not a condition like living in Kerala, but rather an action, with a beginning and end. The only way you can use an action with used to is by considering it as a repeated action
- He used to smoke cigarettes/drink gin/pick his nose/compliment you
that is no longer repeated. But would mean that [living in Kerala for two years] was something I used to do. That, of course, doesn't work. But
- He used to go to work for 2 hours and then duck out for a drink.
is perfectly grammatical if reprehensible, because it's an activity that can be repeated -- that there's time to repeat. So the temporal phrases are fine.
I don't know how these answers would affect an examining board. Given the terrible examples we get here of awful instructional
resources, I have my doubt. But it's all true.