Behaving as if something were true
Your colleague hands out tasks and signs documents, but he isn't the boss. That is what come se is for: Si comporta come se fosse il capo. (“He behaves as if he were the boss.”) The clause describes something that is not real, so it takes the congiuntivo. English works the same way: “as if he were”, “as if he had known”, with the verb one step back in time.
At the same time or earlier
The choice depends on one question: does the imagined situation happen at the same time as the main clause, or before it?
Imperfetto versus trapassato
Same time: imperfetto
The imagined situation holds at the moment of the main clause, like English “as if he were …”: fosse, avesse, sapesse.
Mangia come se avesse fame.
He eats as if he were hungry.
Mi parla come se mi conoscesse da anni.
He talks to me as if he had known me for years.
Guida come se fosse solo lui sulla strada.
He drives as if he were the only one on the road.
Earlier: trapassato
The imagined situation would lie before the main clause, like English “as if he had …”: fosse stato, avesse saputo.
Mangia come se non avesse mangiato da giorni.
He eats as if he hadn't eaten for days.
È uscita come se non fosse successo niente.
She walked out as if nothing had happened.
Parlano di lui come se fosse partito per sempre.
They talk about him as if he had gone away for good.
Come se nulla fosse
A fixed phrase you will hear all the time: come se nulla fosse or come se niente fosse, “as if nothing had happened” or “as if it were nothing”. It usually comes at the end of the sentence and does not change.
Dopo la lite è tornato come se nulla fosse.
After the argument he came back as if nothing had happened.
Ha detto quella cosa terribile come se niente fosse.
He said that terrible thing as if it were nothing.