I found answer in this questionquestion.
It can be done by using addHandle method:
if (//if condition) {
$layout = $observer->getLayout();
$layout->getUpdate()->addHandle('custom_layout_handle_header');
}elseif(//if condition){
$layout = $observer->getLayout();
$layout->getUpdate()->addHandle('custom_layout_handle_right');
}
layout file
<layout>
<custom_layout_handle_header>
<reference name="header">
<block type="core/template" name="header_block" template="template.phtml" />
</reference>
</custom_layout_handle_header>
</layout>
<layout>
<custom_layout_handle_right>
<reference name="right">
<block type="core/template" name="right_block" template="template_file.phtml" />
</reference>
</custom_layout_handle_right>
</layout>