About two months depending on the rostering of TRIs.
One week command ground school
3 sims paired with another upgrade candidate.
LPC
AWO
ZFT
3 Lofts and 1 checkride
10-14 flights route training
Very low failure rate due to excellent training and candidates motivation to study.
3 years on the B777
4 years on the AB
This can change when the A380 shows up later this year
2nd shot depends why you failed the first one. Normally extra training is given. I think its evaluated on a case to case basis.
Anyway, dont worry about command yet. Get in first.
Good luck