You haven't really given enough information for a definitive answer but perhaps this will help.
I created some sample data, with nothing at all in the flag and with only 2 matching records in table B...
declare @A table (commonColumn int, otherData nvarchar(255), flag bit null);
insert into @A (commonColumn, otherData) values
(1,'sample 1'), (2, 'sample 2'), (3, 'sample 3'), (4,'sample 4');
declare @B table (commonColumn int, otherData nvarchar(255));
insert into @B (commonColumn, otherData) values
(2, 'Matches with sample 2'),(3, 'Matches with sample 3');
The simplest way to update the flag when there are no common records is to posit that we don't think we'll find any, so just set everything to 0 = "no match"
update @A set flag = 0;
Then update where you do find a match - this should use an inner join so that the data set returned is only the records that appear in both tables
update a set flag = 1
from @A a
inner join @B b on a.commonColumn = b.commonColumn
select * from @A;
If you didn't want to set everything to 0 up front this is how you would use a left join to do what you want - note the where clause
update a set flag = 0
from @A a
left outer join @B b on a.commonColumn = b.commonColumn
where b.commonColumn is null;
select * from @A;
However, based on the title of your post - here is how to use a case and do it all at once - you still need the left join but the case must do the test for the null instead of the where clause
update a set flag = case when b.commonColumn is null then 0 else 1 end
from @A a
left outer join @B b on a.commonColumn = b.commonColumn;