Example:
Before...
(1) I ate breakfast.
(2) I took a shower.
Before I ate breakfast, I had taken a shower.
After...
(1) She went to the gym for 2 months.
(2) Mary lost 10 kilograms.
when...
(1) Alice worked for the company for 30 years.
(2) She retired.
By the time...
(1) The plane already left.
(2) Brian go to the airport.
Before...
(1) Bret and Lucia went out for a couple of years.
(2) They got married.
When...
(1) He worked for the factory for 15 years.
(2) Andy got sacked.
By the time...
(1) The rain stopped.
(2) The rock concert was over.
Before...
(1) Roger won his first tennis championship.
(2) He played tennis for 10 years.