A modified version for solution posted by Rajat-Indiandotnet. You need to return 0 in else because if there is one record returns NULL then the final result will be NULL. For ex. 1+4+NULL = NULL and NOT 5.
SELECT [Column1],
SUM (CASE WHEN A=0 AND (B=2 or B=1)THEN [Column0]
WHEN A=1 AND B=1 THEN [Column0]
ELSE 0
END) AS AliasName
FROM dbo.Table1
GROUP BY [column1]