why 192.168.1.2/255.255.255.0 is considered as an invalid IP?
I wasn’t sure what you were asking until I viewed your question in the context of the quiz, where the question is a bit more broadly asking for CIDR blocks / IP Addresses that are not valid for a private VPC or subnet in AWS. The wording of the question is a bit awkward in the exam, but when you look at the four examples they provide, three of them are specific IP addresses, and only one of them is a CIDR block.
In the case of the address above, 192.168.1.2/255.255.255.0 can also use the notation 192.168.1.2/24. Again this is a specific IP address and falls in the range 192.168.1.0 to 192.168.1.255. Otherwise stated, IP 192.168.1.2/24 is part of the 192.168.1.0/24 CIDR Block. Within this CIDR Block:
188.8.131.52 is the network address
184.108.40.206 is the broadcast address
AWS reserve the first three IPs of any CIDR block for internal use. For this CIDR block that would include 192.168.1.1/24, 192.168.1.2/24 and 192.168.1.3/24. Since the address in the question above would be reserved by AWS it makes it invalid for use (by users) within a private VPC or subnet in AWS.
The following I think is a bit better reference than the one offered in the quiz notes: https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Subnets.html
Hope this helps,