What to do when you have two manuscripts under review where one cites the other, but the citing paper gets accepted before the cited paper? I submitted an article around 11 months ago to a SCI journal and another article around 5 months ago in another SCI journal. The second article cited the first article which was under review for 6 months at the time of submission of second article. Recently, we got acceptance letter for 2nd article while 1st article is still under review. 
What action should we take? remove the citation in 2nd article and cite the 2nd article in 1st article or we stay with the current situation. but what if our 1st article got rejection?
If I understand correctly, this is your situation:


Paper 1 was submitted for review 11 months ago
Paper 2 was submitted for review six months later. 
Paper 2 was accepted for publication. Paper 1 is still under review.


Presumably, Paper 2 cites Paper 1 as being "submitted". The present version of Paper 1  does not cite Paper 2 because Paper 2 was not in existence when Paper 1 was submitted.

Are these correct? If so, here are some thoughts about your questions:

Should you continue to cite Paper 1 in Paper 2?

I would. The fact that Paper 1 is still under review is out of your control. In fact, its final disposition is also up in the air. Nevertheless, Paper 2 uses information derived from Paper 1, hence the need to cite it. That Paper 2 was accepted with the citation to Paper 1 is important evidence that the reviewers and the editors thought that it was appropriate, despite the "submitted" tag.

Should you remove the citation of Paper 1 in Paper 2?

I wouldn't do this, unless there was a material change in your manuscript. If the parts of Paper 2 that depend on Paper 1 were lost in revision, then fine. However, it is not a good idea to eliminate references simply because of publication status.

Should you cite Paper 2 in Paper 1?

You should only cite papers that support your statements. Frivolously citing one paper of yours just because it was published is a rather trivial reason. However, if you genuinely feel that Paper 2 has substantial contributions to Paper 1, then this should be fine. You would do this in the revision stage. Be aware, though, that alert editorial staff may review this change with skepticism.

If you retain the citation of Paper 1 in Paper 2 and Paper 1 gets rejected, then what happens?

Generally, there's nothing you can do about this. Journals still operate as if the manuscripts were static entities. That is to say, once a final version has been approved at the galley stage, no changes can be made. Paper 1 will always be cited in Paper 2 as being "submitted" in perpetuity. There are some publishing models now that account for this fluidity in publication status, although there are not widespread, and rather experimental. Say, for example, that you cited the work of Doorman (2014) and your work was published in 2015. In 2016, Doorman was found to have committed research misconduct and his 2014 publication was retracted because all the data were fabricated. Well, your 2015 publication would still cite Doorman 2014. There are no easy solutions to this issue as yet.

Good luck.