Q: Logic equation for truth table with don't care condition Problem 1
How I can get the Boolean equation (in sum of products form) for this truth table with a don't care condition:
X Y Z
0 0 1
0 1 X
1 0 X
0 1 1

I should ignore the rows with don't care or there's something that I need to do? 
Problem 2
And in this case:
X Y Z
0 0 0
0 X 1
X 0 1
0 1 X

How I can get the Boolean equation?

A: Well, there are many way to find out the logic equation from the truth table. One of way (probably the easiest to learn) is by using K-map (although it will become fairly complicated and hard to deal with if you have more variable):
http://www.allaboutcircuits.com/textbook/digital/chpt-8/dont-care-cells-karnaugh-map/
I think the link above give you a very good idea on how to deal with don't care term in K-map.
Other than that, if you have much complex equation, you can try doing quine mccluskey algorithm which you can find in the link below:
https://www.youtube.com/watch?v=B08vV3tIdag
For Problem 2 you mentioned,I am assuming Z is the output and X, Y are the input,to the best of my knowledge, I am not sure if you can do that because your second case X:0,Y:X,Z:1 is conflicting with your first case. It says that when x is 0, you don't care about the value of Y and the output has to be 1. But in your first case, you did specify the condition that when Y is 0 and X is 0, Z has to be 0. If that's possible to figure out the Boolean equation, please keep this posting and I will check it out.
